Tuesday 5 January 2016

Building OpenJDK with OpenJFX Jigsaw prototype on Windows

This post is a step by step to build the OpenJDK with OpenJFX Jigsaw prototype on Windows (10 64bits).
For OpenJDK 9 and OpenJFX 9 see the adjusted page.

Update 2016-10-08: Mercurial URL changed

  1. Create a C:\dev\ directory


     
  2. Download and install Visual Studio 2013 Community
    1. Download (it may be faster to download the ISO)
    2. Install
      • uncheck all the options
      • or download AdminDeployment.xml to C:\dev\temp then start the installation with:
        vs_community.exe /AdminFile C:\dev\temp\AdminDeployment.xml
    3. Add the path to MSBuild to the PATH environement variable (required to build Freetype):
      C:\Program Files (x86)\MSBuild\12.0\Bin
  3. Download and install the Mercurial for Windows 
  4. Download and install Java 8 (for OpenJDK)
  5. Download and install JDK 9 b109
  6. Move C:\Program Files\Java\jdk-9\lib\jfxrt.jar out of the way (rename it jfxrt.jar.disabled for instance)
  7. Download and install Babun, then use its package manager to install zip :
    pact install zip
  8. Download Freetype source (2.6.2) and extract to C:\dev\freetype-2.6.2
  9. Download Gradle 2.11 and extract it into C:\dev

     
  10. Get Jake's source
    In the Babun console:

    cd /cygdrive/c/dev
    hg clone http://hg.openjdk.java.net/jigsaw/jake
    cd /cygdrive/c/dev/jake
    ./get_source.sh
  11. Get OpenJFX Jigsaw prototype source
    In the Babun console:
    cd /cygdrive/c/dev
    hg clone http://hg.openjdk.java.net/openjfx/sandbox-9-jake/rt/ jfx-jake


    
    
  12. Build OpenJFX
    In the 'DOS' console:
    cd C:\dev\jfx-jake
    set GRADLE_HOME=C:\dev\gradle-2.11
    set JAVA_HOME=C:\Program Files\Java\jdk-9
    set PATH=%PATH%;%JAVA_HOME%\bin;%GRADLE_HOME%\bin;%USERPROFILE%\.babun\cygwin\bin

    gradle
  13. Run the auto-conf script for OpenJDK
    In the Babun console:
    cd /cygdrive/c/dev/jake
    bash configure --with-freetype-src=/cygdrive/c/dev/freetype-2.6.2 --with-import-modules=/cygdrive/c/dev/jfx-jake/build/modular-sdk
  14. Time for cooking
    make images
    
    
    
  15. Once done, open a new 'DOS' console and navigate to
    cd C:\dev\jake\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.  To check JavaFX,
    in the 'DOS' console compile the sample apps:
    cd C:\dev\jfx-jake
    set GRADLE_HOME=C:\dev\gradle-2.11
    set JAVA_HOME=C:\Program Files\Java\jdk-9
    set PATH=%PATH%;%JAVA_HOME%\bin;%GRADLE_HOME%\bin;%USERPROFILE%\.babun\cygwin\bin

    set JIGSAW_HOME=C:\dev\jake\build\windows-x86_64-normal-server-release\images\jdk
    gradle apps

    then launch:
    %JIGSAW_HOME%\bin\java -jar C:\dev\jfx-jake\apps\samples\Ensemble8\dist\Ensemble8.jar
  17. hack!