Running JBoss on an OpenJDK6 build

Recently, I had some free time and set out to bring up JBoss on OpenJDK6. In particular, I wanted to Run JBoss on an OpenJDK build that I personally compiled.

I successfully accomplished this.

This tutorial uses Fedora Core 9 on an x86 platform.

Instructions

Complete instructions for how to compile OpenJDK is included in the download file ( openjdk/README-builds.html).

Read these instructions. It contains important information. This tutorial adds a few details I identified along the way.

Download

OpenJDK source code can be downloaded from http://download.java.net/openjdk/jdk6/.

Explode the jar into a working directory.

There are several additional libraries that need to be downloaded that can also be placed into this working directory. For Fedora Core 9, these are:

Compiling

Add the following lines to the ${BUILD_HOME}/jdk/make/jdk_generic_profile.sh:

ALT_BOOTDIR=PATH_TO_JAVA
ALT_BINARY_PLUGS_PATH=${BINARY_PLUGIN_HOME}/binary-plugin/openjdk-binary-plugs
ALT_JIBX_LIBS_PATH${JIBX_HOME}/jibx/lib
ALT_SLASH_JAVA=${PATH_TO_BUILD_DIRECTORY}

For JIBX, even after setting ALT_JIBX_LIBS_PATH, I couldn’t get it to find my new location. So, I simply created a directory structure that allowed the build to find the JIBX_HOME/lib directory at:

  • /NOT-SET/devtools/share/jibx/lib

Ensure that CLASSPATH, JAVA_HOME, and LANG environment variables are not set.

At this point, per the instructions, issuing “gmake sanity”. Then, “gmake”.

I have an older machine( ~2005). It took a little more than one hour to compile the full JDK.

Once compilation is complete, the new JDK can be found at: $WORKING_DIR/build/linux-i586/j2sdk-image.

JBoss Setup

If JBoss was setup using the instructions provided in this article, the following instructions should allow the JBoss default container to start using the new JDK.

  1. Change the JAVA_HOME variable of the start script to point at WORKING_DIR/build/linux-i586/j2sdk-image.
  2. Restart the JBoss container.