Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8026964

Building with an IBM J9 boot jdk requires special settings for BOOT_RTJAR

    Details

      Description

      With OpenJDK/Oracle based boot jdks $(BOOT_RTJAR) is simply set to "$BOOT_JDK/jre/lib/rt.jar" but this doesn't work with IBM J9 because many of the classes which are in "rt.jar" in OpenJDK are spread over other jar files in J9.

      This leads to problems during the build if the newly compiled javac is executed with "-source 7 -target 7 -bootclasspath $(BOOT_RTJAR)" because J9 will not find basic classes like Object which are not in rt.jar.

      I managed to compile JDK8 with IBM J9 as bootstrap jdk with the following extra settings in "boot-jdk.m4"

      diff -r 584dc2e95e04 common/autoconf/boot-jdk.m4
      --- a/common/autoconf/boot-jdk.m4 Thu Sep 12 12:29:17 2013 -0700
      +++ b/common/autoconf/boot-jdk.m4 Mon Oct 21 16:22:35 2013 +0200
      @@ -268,6 +268,14 @@
             BOOT_RTJAR="`cd ${BOOT_RTJAR%/*} && pwd`/${BOOT_RTJAR##*/}"
           fi
       fi
      +# IBM J9 jdks need a special BOOT_RTJAR setting
      +if $BOOT_JDK/bin/java -version 2>&1 | grep 'IBM J9'; then
      + BOOT_RTJAR="$BOOT_RTJAR:$BOOT_JDK/jre/lib/math.jar:$BOOT_JDK/jre/lib/xml.jar"
      + IBM_J9_VM_JAR=`$BOOT_JDK/bin/java -XshowSettings 2>&1 | $TR ' ' '\n' | grep 'vm.jar'`
      + if test "x$IBM_J9_VM_JAR" != x; then
      + BOOT_RTJAR="$BOOT_RTJAR:$IBM_J9_VM_JAR"
      + fi
      +fi
       BOOT_TOOLSJAR="$BOOT_JDK/lib/tools.jar"
       BOOT_JDK="$BOOT_JDK"
       AC_SUBST(BOOT_RTJAR)

      So this adds math.jar (needed for e.g. BigInteger), xml.jar (needed for e.g. SAXParser) and vm.jar (needed for e.g. Object) to $(BOOT_RTJAR). Not sure if this is enough for all future use but will ask IBM colleagues about it.

        Attachments

          Activity

            People

            • Assignee:
              simonis Volker Simonis
              Reporter:
              simonis Volker Simonis
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: