HOW TO CONTRIBUTE TO OPENJDK


Introduction

At the JavaOne 2007 Sun signed the charter for the open-source Java community project. This way  Java and the JVM becomes open-source software under the GPL license. Even though that might sound scarry Sun made sure that using the JDK under GPL is not requiring a company to open-source its software.
Sun hopes that it can grow a community around the OpenJDK project so that Java can grow as well as its marketshare and that the community and of course Sun can take advantage of it.

Even though Java is not open-source it can only prosper if the community including Sun is making it a success. Just remember how much time you spent on creating a workaround for a Java bug. Now you can just fix it, build and us the new Java for now. After contributing the fix to Java it will be fixed for good.

This article is showing you how to build, fix and contribute a bug fix or enhancements to the OpenJDK project helping you and others to save time and to get the best out of Java.

We will try to keep that document as up to date as possible and in order for you to check I will mention the last update here:

Last Update: 5/13/07



Setup the Project

Before we can start coding we need to setup the project so that we can build and test the project. There are some dependencies to be installed, the download the the binary plugins, the OpenJDK source and jtreg test application.


Install the Dependencies

These are the dependencies for OpenSuSE 10.2 because it is my development environment. That said it should be possible to apply it to any other Linux system.
That should do the trick.

Setup the OpenJDK Project

There are 3 parts necessary to setup the OpenJDK project which can be downloaded from the OpenJDK website and look for source-code bundle:
  1. Binary Plugs according to your platform
  2. jtreg test harness (Java based)
  3. The latest source code either as bundle from this website or from the Subversion repository with
    1. URL: https://openjdk.dev.java.net/svn/openjdk/jdk/trunk
    2. Username: guest
    3. Password: guest

Build the Project

There are some environment variables to be set before a built can be started. First you need a script like this one to set your personal settings:
-----------------------------------------------
#!/bin/sh

# Path to the Base JDK which can
# also by the path to the Binary Plugs
export ALT_BOOTDIR=/home/openjdk/bin.plugs/jdk1.7.0
# Path to the Binary Plugs
export ALT_CLOSED_JDK_IMPORT_PATH=/home/openjdk/bin.plugs/jdk1.7.0
# Requested by OpenJDK Build
export LANG=C
# Requested by OpenJDK Build
export JAVA_HOME=

# Path the root directory containing the Motif headers
export ALT_MOTIF_DIR=/usr/X11R6
-----------------------------------------------
Then we need to execute a setup script:
    <openjdk source root>/j2se/make/jdk-generic-profile.sh

Now we are ready to fire up the build:

cd <openjdk source root>control/make
gmake sanity
gmake


If everything works well you will find a new build inside:
<openjdk source root>control/build/<platform>





MAD plaNETMAD plaNET: Advanced Internet Technology