Sunday, 1 June 2014

Building Java 9 on Windows

This version focuses on building Java 9 on Windows (8.1 64bits) and takes a few short-cuts from the Java 8 version (refer to that version if you get issues).

Last updated: 2015-05-14, fixed JDK image path, Freetype 2.5.5, use cygpaths

  1. Download and install Windows SDK 7.1 (there is no need for the samples and .Net tools)
  2. Download and install Microsoft DirectX 9.0 SDK (the ReadMe says the version from summer 2004, however this does not seem to still be available from Microsoft, the version from June 2010 seems to be a working replacement)
  3. Download and install the Mercurial for Windows
  4. Download and install Java 8 (if not already done)
  5. Download and install Babun, then use its package manager to install zip :
    pact install zip
  6. Create a C:\dev\ directory 
  7. Download Freetype source (2.5.5) and extract to C:\dev\freetype-2.5.5
  8. In the Babun console:
    cd /cygdrive/c/dev/jdk9
    (use a slash / instead of a back-slash \ )
  9. Get the root source:
    hg clone http://hg.openjdk.java.net/jdk9/jdk9/
     (or the more bleeding edge http://hg.openjdk.java.net/jdk9/dev/ )
  10. Move to the new directory
    cd /cygdrive/c/dev/jdk9
  11. Get the remainder of the source
    ./get_source.sh 
  12. Force the permissions
    chmod -R u+rwxs .
    (otherwise some files get access denied errors)
  13. Run the auto-conf script
    bash configure --with-freetype-src=/cygdrive/c/dev/freetype-2.5.5
  14. Time for cooking
    make images
  15. Once done, open a new standard Windows console and navigate to
    C:\dev\jdk9\build\windows-x86_64-normal-server-release\images\jdk
    check that java runs:
    bin\java -version
    or for something a bit more visual:
    bin\jconsole
  16. enjoy!
For day to day refresh do the following (in the Babun shell):
  1. Go to the JDK directory
    cd /cygdrive/c/dev/jdk9
  2. Get the sources updates
    ./get_source.sh
  3. Force the permissions
    chmod -R u+rwxs .
  4. Remove the build directory
    rm -rf build/
  5. Rerun the auto-conf script to update the time stamp of the build:
    bash configure --with-freetype-src=/cygdrive/c/dev/freetype-2.5.5
  6. Re-heat
    make images