Version 6

    These are the steps I had to take to build OpenJDK on my ubuntu installation. Hopefully I haven't forgotten too many things :-) Some of them are from the OpenJDK Build README and the open jdk repositories guide and the rest through trial+error+google.

    • Install Mercurial and the forest extension. The forest.py and my ~/.hgrc (attached as "hgrc") files are attached. The forest.py attached works with mercurial 0.9.x, apparently there is a newer version that works with mercurial post-1.0.0
    • Check out the mercurial repository in ~/sourcecontrol/jdk7
    • There are a bunch of libraries that need installing that can be found in the OpenJDK Build README. Also, if you install the "openjdk-6-source" package that installs all the dependencies.
    • Install JDK 6
    • Download the OpenJDK binary plugs. Go to the folder and run
      • $ java -jar name-of-binary-plugs.jar
      • select a location, the rest assumes ~/sourcecontrol/jdk7/mytl/ so the folder we need later will be ~/sourcecontrol/jdk7/mytl/openjdk-binary-plugins
    • Set some environment variables
      • ALT_BOOTDIR to the root of the JDK 6 installation. This must be the real jdk path, not the link found in /usr/bin, e.g:
        • export ALT_BOOTDIR=/usr/lib/jvm/java-6-sun
      • export ALT_BINARY_PLUGS_PATH=/home/kabir/sourcecontrol/jdk7/mytl/openjdk-binary-plugins
    • Now go to the ~/sourcecontrol/jdk7/mytl folder
      • replace hotspot/src/share/vm/libadt/port.hpp with the attached port.hpp
      • $chmod 777 ./jdk/make/jdk_generic_profile.sh
      • $./jdk/make/jdk_generic_profile.sh
      • $make sanity
        • This will tell you if there are some libraries you have not got installed
      • $make WARNINGS_ARE_ERRORS=
        • The "WARNINGS_ARE_ERRORS=" bit does not pass in the -Werror flag to gcc. With the -Werror flag some of the hotspot files fail to compile