Building OpenJDK 9 with OpenJFX 9 on Ubuntu (VBox and WSL)
Wanting to test Windows Subsystem for Linux, I’ve refreshed my steps for
building on Ubuntu.
(Dependencies come from the helpful configure messages for the JDK and
from the OpenJFX wiki)
Quick steps for installing WSL:
Activate the developer’s mode in settings
In an administrator PowerShell console run:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
Open Bash and install Ubuntu (the following also applies to a VirtualBox VM)
To build OpenJFX and OpenJDK 9:
Install the dependencies:
sudo apt install mercurial openjdk-8-jdk make unzip zip g++ libx11-dev libxext-dev libxrender-dev libxtst-dev libcups2-dev libfreetype6-dev libasound2-dev ksh bison flex gperf libasound2-dev libgl1-mesa-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libjpeg-dev libpng-dev libxml2-dev libxslt1-dev libxt-dev libxxf86vm-dev pkg-config x11proto-core-dev x11proto-xf86vidmode-dev libavcodec-dev libgtk2.0-dev libgtk-3-dev libxtst-dev libudev-dev libavformat-dev
Create the dev directory:
mkdir ~/dev
cd ~/devRetrieve specific dependencies for OpenJFX:
wget https://services.gradle.org/distributions/gradle-3.1-bin.zip
unzip gradle-3.1-bin.zip
export PATH=$PATH:/dev/gradle-3.1/bin/dev/apache-ant-1.8.2/bin
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.8.2-bin.zip
unzip apache-ant-1.8.2-bin.zip
export PATH=$PATH:
wget http://download.java.net/java/jdk9/archive/168/binaries/jdk-9-ea+168_linux-x64_bin.tar.gz
gunzip jdk-9-ea+168_linux-x64_bin.tar.gz
tar x -f jdk-9-ea+168_linux-x64_bin.tarGet the sources:
hg clone http://hg.openjdk.java.net/openjfx/9-dev/rt jfx
hg clone http://hg.openjdk.java.net/jdk9/jdk9/
cd ~/dev/jdk9
bash ./get_source.shSet the env variables for OpenJFX:
export _JAVA_OPTIONS="-Dsun.reflect.debugModuleAccessChecks=true –add-opens=java.base/java.lang=ALL-UNNAMED –add-opens=java.base/java.util=ALL-UNNAMED –add-opens=java.base/java.lang.invoke=ALL-UNNAMED –add-opens=java.base/java.io=ALL-UNNAMED –add-opens=java.base/java.util.concurrent=ALL-UNNAMED –add-opens=java.base/java.text=ALL-UNNAMED -Dorg.gradle.daemon=false"
export JAVA_HOME=/dev/jdk-9//dev/jdk-9/
export JDK_HOME=Build OpenJFX:
cd ~/dev/jfx
gradleUnset the env variables for OpenJFX (to avoid interfering with the configuration of OpenJDK):
export -n _JAVA_OPTIONS
export -n JAVA_HOMEConfigure and Build OpenJDK:
cd ~/dev/jdk9
bash configure –with-import-modules=`echo ~/dev/jfx/build/modular-sdk/`
make imagesEnjoy