Building a UI toolkit for many different platforms is a complex and challenging endeavor. It requires platform specific tools such as C compilers as well as portable tools like Gradle. Which tools must be installed differs from platform to platform. While the OpenJFX build system was designed to remove as many build hurdles as possible, it is often necessary to build native code and have the requisite compilers and toolchains installed. On Mac and Linux this is fairly easy, but setting up Windows is more difficult.
Table of Contents |
---|
Platform Prerequisites
Windows
In order to build OpenJFX, it is necessary to have all of the tools needed on the system you are building with.
Java SE 8
Since each release of OpenJFX is paired with a corresponding release of the JDK, you should make sure that you have a recent (preferably the latest) promoted build of the JDK available.The current supported build can be downloaded Java SE 8 download page, or the latest early access from JDK 8 java.net. Some make it a practice to always run against the latest promoted build, others will stick with an older build until they finally can't build OpenJFX with it anymore, and then update. Whichever method you chose, you need to have a reasonably recent version of JDK 8 installed.
The OpenJFX build requires a Java JDK 8 that does not have the JFX jar present. The build scripts check for this condition, and will refuse to continue if it is found.This jar is found in the JDK at (your JDK)/jre/lib/ext/jfrt.jar. A common practice is to have a copy the JDK for general use, and another for building, and then remembering to set your PATH when building to the proper JDK. There are many ways to copy the JDK, and which one to use can depend on which OS you are using.
Some versions of Linux may have an installed Java that is not new enough, and may already be in your path, which will cause confusion as you try to build.
Make sure you have the right Java in your path with:
java -version
Mercurial
OpenJFX, as with OpenJDK, uses Mercurial as the source control system. You must install some support for using Mercurial. Many (if not all) IDEs include built in support, although the tooling is generally not as good as you might get from a standalone tool. Popular options include SourceTree from Atlassian, TortoiseHg for Windows, or the command line tools from Mercurial.
Gradle
You must also install Gradle. We are using Gradle v1.8 (IMPORTANT: Only Gradle 1.8 is guaranteed to work).
Below are platform specific configuration instructions. Note that if all you want to do is hack on Java code, there is very little you need to configure (but testing becomes a little more difficult). Building only the JavaFX natives requires a little more in terms of tooling setup, but allows you to hack on Glass, Prism, and other native code. Setting up to build WebKit is the most work, and building WebKit takes the longest, but allows you to really build the whole thing an run an application completely on Open Source software.
Windows
You need to have the following tools installed:
- Cygwin. Some packages to make sure are installed are:
- openssh
- bison
- flex
- g++
- gperf
- make
- makedepend
- perl
- zip
- unzip
- DirectX SDK June 2010. Microsoft DirectX SDK (June 2010) headers are required for building the JavaFX SDK. This DirectX SDK can be downloaded from Microsoft DirectX SDK (June 2010). If the link above becomes obsolete, the SDK can be found from the Microsoft Download Site (search with "DirectX SDK June 2010"). The location of this SDK will normally be set with the environment variable DXSDK_DIR at installation time. The default location is normally "C:/Program Files/Microsoft DirectX SDK (June 2010)/". If DXSDK_DIR is not set, the build process may look for it in the default location or "C:/DXSDK/".
- Microsoft Visual Studio 10 SP1 (express edition works). The compiler and other tools are expected to reside in the location defined by the variableVS100COMNTOOLS which is set by the Microsoft Visual Studio installer.
Mac
To configure your Mac, make sure you have at least version 10.7 installed. Install the latest version of Xcode and that you have the developer tools installed. You can install them by using the menus within Xcode: XCode -> Preferences -> Downloads -> Components. Install the latest JDK 8 build. In order to build WebKit, you will also need to install QT (because WebKit uses QTMake and some other such tools).
IMPORTANT: If you have a different version of X code (say one that is compatible with OS X 10.9), you will need to add the following line to your ~/.gradle/gradle.properties
file:
MACOSX_MIN_VERSION=10.9
Depending on the version of X code that you have, the value of MACOSX_MIN_VERSION may need to be different (ie. 10.8). If you do not set this variable correctly, the C code will not build.
...
You need to have the following tools installed:
- Cygwin. Some packages to make sure are installed are:
- openssh
- bison
- flex
- g++
- gperf
- make
- makedepend
- perl
- zip
- unzip
- DirectX SDK June 2010. Microsoft DirectX SDK (June 2010) headers are required for building the JavaFX SDK. This DirectX SDK can be downloaded from Microsoft DirectX SDK (June 2010). If the link above becomes obsolete, the SDK can be found from the Microsoft Download Site (search with "DirectX SDK June 2010"). The location of this SDK will normally be set with the environment variable DXSDK_DIR at installation time. The default location is normally "C:/Program Files/Microsoft DirectX SDK (June 2010)/". If DXSDK_DIR is not set, the build process may look for it in the default location or "C:/DXSDK/".
- Microsoft Visual Studio 10 SP1 (express edition works). The compiler and other tools are expected to reside in the location defined by the variableVS100COMNTOOLS which is set by the Microsoft Visual Studio installer.
Mac
To configure your Mac, make sure you have at least version 10.7 installed. Install the latest version of Xcode and that you have the developer tools installed. You can install them by using the menus within Xcode: XCode -> Preferences -> Downloads -> Components. Install the latest JDK 8 build. In order to build WebKit, you will also need to install QT (because WebKit uses QTMake and some other such tools).
IMPORTANT: If you have a different version of X code (say one that is compatible with OS X 10.9), you will need to add the following line to your ~/.gradle/gradle.properties
file:
MACOSX_MIN_VERSION=10.9
Depending on the version of X code that you have, the value of MACOSX_MIN_VERSION may need to be different (ie. 10.8). If you do not set this variable correctly, the C code will not build.
Anchor | ||||
---|---|---|---|---|
|
Setting up a Linux build configuration is fairly straightforward. These build instructions were used for the "official" build platform of Ubuntu 10.04, but also on the latest Ubuntu 12.10. First, run the following command to install all the required development packages:
Ubuntu 12, 14
sudo apt-get update
sudo apt-get install bison flex gperf libasound2-dev libgl1-mesa-dev \
libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libjpeg-dev \
libpng-dev libx11-dev libxml2-dev libxslt1-dev libxt-dev \
libxxf86vm-dev pkg-config qt4-qmake x11proto-core-dev \
x11proto-xf86vidmode-dev libavcodec-dev mercurial libgtk2.0-dev \
ksh libxtst-dev libudev-dev
Fedora 21
yum install mercurial bison flex gperf ksh pkgconfig \
libpng12-devel libjpeg-devel libxml2-devel \
libxslt-devel systemd-devel glib2-devel gtk2-devel \
libXtst-devel pango-devel freetype-devel
Linux ARM
Building OpenJFX for Linux ARM has only been tested on as a cross build from Linux and MacOSX. The process is only regularly used on Linux. Follow the steps for a Linux build setup first, and then refer to the steps for Cross Building for ARM Hard Float.
Common Prerequisites
Java SE 8
Since each release of OpenJFX is paired with a corresponding release of the JDK, you should make sure that you have a recent (preferably the latest) promoted build of the JDK available.The current supported build can be downloaded from the Java SE 8 download page. Some make it a practice to always run against the latest promoted build, others will stick with an older build until they finally can't build OpenJFX with it anymore, and then update. Whichever method you chose, you need to have a reasonably recent version of JDK 8 installed.
The OpenJFX build requires a Java JDK 8 that does not have the JFX jar present. The build scripts check for this condition, and will refuse to continue if it is found.This jar is found in the JDK at (your JDK)/jre/lib/ext/jfrt.jar. A common practice is to have a copy the JDK for general use, and another for building, and then remembering to set your PATH when building to the proper JDK. There are many ways to copy the JDK, and which one to use will depend on which OS you are using.
Some versions of Linux may have an installed Java that is not new enough, and may already be in your path, which will cause confusion as you try to build.
Make sure you have the right Java in your path with:
java -version
Mercurial
OpenJFX, as with OpenJDK, uses Mercurial as the source control system. You must install some support for using Mercurial. Many (if not all) IDEs include built in support, although the tooling is generally not as good as you might get from a standalone tool.
Popular options include SourceTree from Atlassian, TortoiseHg for Windows, or the command line tools from Mercurial.
For Linux, the Mercurial package is included in the list of required packaged that were installed.
Gradle
You must also install Gradle. We are using Gradle v1.8 (IMPORTANT: Only Gradle 1.8 is guaranteed to work).
Environment Variables
At a minimum, you will need to have gradle, java and javac in your path.
Set JAVA_HOME to point to the top of the JDK 8 installation (that has jfxrt.jar removed)
...
Setting up a Linux build configuration is fairly straightforward. These build instructions were used for the "official" build platform of Ubuntu 10.04, but also on the latest Ubuntu 12.10. First, run the following command to install all the required development packages:
Ubuntu 12, 14
sudo apt-get update
sudo apt-get install bison flex gperf libasound2-dev libgl1-mesa-dev \
libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libjpeg-dev \
libpng-dev libx11-dev libxml2-dev libxslt1-dev libxt-dev \
libxxf86vm-dev pkg-config qt4-qmake x11proto-core-dev \
x11proto-xf86vidmode-dev libavcodec-dev mercurial libgtk2.0-dev \
ksh libxtst-dev libudev-dev
Fedora 21
yum install mercurial bison flex gperf ksh pkgconfig \
libpng12-devel libjpeg-devel libxml2-devel \
libxslt-devel systemd-devel glib2-devel gtk2-devel \
libXtst-devel pango-devel freetype-devel
Linux ARM
Building OpenJFX for Linux ARM has only been tested on as a cross build from Linux and MacOSX. The process is only regularly used on Linux. Follow the steps for a Linux build setup first, and then refer to the steps for Cross Building for ARM Hard Float.
Getting the Sources
All OpenJFX sources are held in mercurial repositories. As mentioned in Repositories and Releases, we have several different repositories for you to choose from.
...