• Home
    • View
    • Login
    This page
    • Normal
    • Export PDF
    • Export Word
    • Attachments
    • Page Information

    Loading...
  1. Dashboard
  2. OpenJFX
  3. Main
  4. Getting Started
  5. Building OpenJFX

Page History

Versions Compared

Old Version 151

changes.mady.by.user Nir Lisker

Saved on Aug 23, 2022

compared with

New Version Current

changes.mady.by.user Kevin Rushforth

Saved on Aug 14, 2024

  • Previous Change: Difference between versions 150 and 151
  • View Page History

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Do you really want to build OpenJFX? We would like you to, but the latest stable build is already available on the JavaFX website, and JavaFX 8 is bundled by default in Oracle JDK 8 (9 and 10 also included JavaFX, but were superseded by 11, which does not). There are also some great community builds that may work for you.

Starting with Java 9, and the introduction of the module system, the JavaFX modules are now an integral part of the runtime environment for the desktop. Because of this tie, there is currently no provision or capability for the output of the OpenJFX 9 or later build to be used as an overlay. It is still possible however to develop and enhance OpenJFX, and use that result to build an OpenJDK. (still relevant?)

We are exploring making this easier, by enabling a developer to build a set of javafx.* modules that can be used with a clean OpenJDK build (without the javafx.* modules). Stay tuned.

...

Windows

You will need Windows 7 10 or later (Windows 10 is recommended) 64-bit OS.

You need to have the following tools installed:

  • Cygwin. Some packages to make sure are installed are:
    • openssh
    • zip
    • unzip
    • make (needed to compile media)
    • makedepend (needed for media)
    • Optional: git
  • Microsoft Visual Studio 2019, either Professional 2022. You can use the Enterprise, Professional, or Community edition or the command line BuildTools. The Desktop development with C++ workload is required at most, but it may be possible to install individual components to satisfy the requirements.
  • Microsoft DirectShow header files – If you build media you will need the DirectShow header files from the Microsoft Windows SDK v7.1, installed in its default location of "C:\Program Files\Microsoft SDKs\Windows\v7.1".

If you build If you build WebKit (it is not built by default) you will need the following additional tools:

  • Cmake 3.822.2 3 or later, available from the Cmake download site
  • Additional Cygwin tools:
    • bison
    • flex
    • g++
    • gperf
    • perl
    • python
    • (5.10 or later)
    • python3
    • ruby (2.5 or later)ruby

All commands on this page are ran run inside Cygwin (and not in Windows CMD).

You will likely The JavaFX build will automatically locate your Visual Studio installation, as long as you installed it in the default location. You no longer need to set the following any env variables to point to your VS 2019 2022 installation, since Microsoft no longer sets such variables. This presumes that:

  • You installed JDK N in C:\Program Files\Java\jdk-N where N is the JDK version.
  • You installed the Community edition of Visual Studio 2019 in C:\Program Files (x86)\Microsoft Visual Studio\2019\Community. If this isn't set correctly, you might see an error during the build saying that vcvars32.bat is missing.

unless you installed Visual Studio in a non-standard location, for example, the D: drive instead of the default C: drive.

Missing paths issue

The initial build process that generates the needed resources is done by the buildSrc folder. On Windows, it tries to locate all the needed tools and write their paths to the build\windows_tools.properties file. If it fails, the file is left blank, which results in a fatal error. In this case, define the VSCOMNTOOLS variable (older versions of JavaFX used VS150COMNTOOLS) to point to the VC\Auxiliary\Build directory in your Visual studio Installation. For example, use the following if you installed Visual Studio 2022 on the D: driveYou should adjust these as needed for your system.

Code Block
export VS150COMNTOOLSVSCOMNTOOLS="C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Auxiliary\\Build"
export JAVA_HOME="C:/Program Files/Java/jdk-N"

Note the use of the double backslash in the VS150COMNTOOLS env var. This is needed because the cygwin shell uses the '\' as an escape character. With JAVA_HOME it is easier to just set it using forward slashes (although backslashes are fine as long as you escape them).

If these definitions aren't persisted between launches of Cygwin, you can either set them in the Windows Environment Variables UI or in the /home/$user$/.bash_profile file (these are ran on startup). Use export -p to verify that the env variables are set correctly.

Missing paths issue

The initial build process that generates the needed resources is done by the \buildSrc folder. On Windows, it tries to locate all the needed tools and write their paths to the \build\windows_tools.properties file. Sometimes it fails and the file is left blank, which results in various path-not-found errors, e.g., on WINSDK_DIR. This means that you will have to define these paths manually. For your convenience, here is a ready file from Win10 with VS2019 Community edition. You will need to correct the user name and possibly the version numbers, but it should give an idea of what the build looks for:

Code Block
titlewindows_tools.properties
collapsetrue
WINDOWS_VS_DEVENVDIR=C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE
WINDOWS_VS_DEVENVCMD=C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/devenv.com
WINDOWS_VS_VCINSTALLDIR=C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC
WINDOWS_VS_VSINSTALLDIR=C:/Program Files (x86)/Microsoft Visual Studio/2019/Community
WINDOWS_VS_MSVCDIR=C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC
WINDOWS_VS_INCLUDE=C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/ATLMFC/include;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/include;C:/Program Files (x86)/Windows Kits/NETFXSDK/4.8/include/um;C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt;C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/shared;C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/um;C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/winrt;C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/cppwinrt;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/ATLMFC/include;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/include;C:/Program Files (x86)/Windows Kits/NETFXSDK/4.8/include/um;C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt;C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/shared;C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/um;C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/winrt;C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/cppwinrt
WINDOWS_VS_LIB=C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/ATLMFC/lib/x64;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/lib/x64;C:/Program Files (x86)/Windows Kits/NETFXSDK/4.8/lib/um/x64;C:/Program Files (x86)/Windows Kits/10/lib/10.0.19041.0/ucrt/x64;C:/Program Files (x86)/Windows Kits/10/lib/10.0.19041.0/um/x64;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/ATLMFC/lib/x86;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/lib/x86;C:/Program Files (x86)/Windows Kits/NETFXSDK/4.8/lib/um/x86;C:/Program Files (x86)/Windows Kits/10/lib/10.0.19041.0/ucrt/x86;C:/Program Files (x86)/Windows Kits/10/lib/10.0.19041.0/um/x86
WINDOWS_VS_LIBPATH=C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/ATLMFC/lib/x64;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/lib/x64;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/lib/x86/store/references;C:/Program Files (x86)/Windows Kits/10/UnionMetadata/10.0.19041.0;C:/Program Files (x86)/Windows Kits/10/References/10.0.19041.0;C:/windows/Microsoft.NET/Framework64/v4.0.30319;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/ATLMFC/lib/x86;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/lib/x86;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/lib/x86/store/references;C:/Program Files (x86)/Windows Kits/10/UnionMetadata/10.0.19041.0;C:/Program Files (x86)/Windows Kits/10/References/10.0.19041.0;C:/windows/Microsoft.NET/Framework/v4.0.30319
WINDOWS_VS_PATH=;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/Extensions/Microsoft/IntelliCode/CLI;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/bin/HostX64/x64;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/VC/VCPackages;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/TestWindow;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/TeamFoundation/Team Explorer;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/bin/Roslyn;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Team Tools/Performance Tools/x64;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Team Tools/Performance Tools;C:/Program Files (x86)/Microsoft Visual Studio/Shared/Common/VSPerfCollectionTools/vs2019/x64;C:/Program Files (x86)/Microsoft Visual Studio/Shared/Common/VSPerfCollectionTools/vs2019/;C:/Program Files (x86)/Microsoft SDKs/Windows/v10.0A/bin/NETFX 4.8 Tools/x64/;C:/Program Files (x86)/HTML Help Workshop;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/FSharp/;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/Tools/devinit;C:/Program Files (x86)/Windows Kits/10/bin/10.0.19041.0/x64;C:/Program Files (x86)/Windows Kits/10/bin/x64;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/Bin;C:/windows/Microsoft.NET/Framework64/v4.0.30319;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/Tools/;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/Extensions/Microsoft/IntelliCode/CLI;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/bin/HostX86/x86;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/VC/VCPackages;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/TestWindow;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/TeamFoundation/Team Explorer;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/bin/Roslyn;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Team Tools/Performance Tools;C:/Program Files (x86)/Microsoft Visual Studio/Shared/Common/VSPerfCollectionTools/vs2019/;C:/Program Files (x86)/Microsoft SDKs/Windows/v10.0A/bin/NETFX 4.8 Tools/;C:/Program Files (x86)/HTML Help Workshop;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/FSharp/;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/Tools/devinit;C:/Program Files (x86)/Windows Kits/10/bin/10.0.19041.0/x86;C:/Program Files (x86)/Windows Kits/10/bin/x86;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/Bin;C:/windows/Microsoft.NET/Framework/v4.0.30319;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/Tools/;C:/Users/runneradmin/bootjdk/jdk-15.0.2/bin;C:/Users/runneradmin/build-tools/apache-ant-1.10.5/bin;C:/Users/runneradmin/cygwin/cygwin64/bin;C:/Users/runneradmin/cygwin/cygwin64/bin;C:/Program Files/PowerShell/7;C:/Users/runneradmin/.dotnet/tools;C:/Program Files/MongoDB/Server/4.4/bin;C:/aliyun-cli;C:/vcpkg;C:/cf-cli;C:/Program Files (x86)/NSIS/;C:/Program Files/Mercurial/;C:/hostedtoolcache/windows/stack/2.5.1/x64;C:/tools/ghc-9.0.1/bin;C:/Program Files/dotnet;C:/mysql-5.7.21-winx64/bin;C:/Program Files/R/R-4.0.4/bin/x64;C:/SeleniumWebDrivers/GeckoDriver;C:/Program Files (x86)/sbt/bin;C:/Rust/.cargo/bin;C:/Program Files (x86)/GitHub CLI;C:/Program Files/Git/bin;C:/Program Files (x86)/pipx_bin;C:/hostedtoolcache/windows/go/1.15.8/x64/bin;C:/hostedtoolcache/windows/Python/3.7.9/x64/Scripts;C:/hostedtoolcache/windows/Python/3.7.9/x64;C:/hostedtoolcache/windows/Ruby/2.5.8/x64/bin;C:/Program Files/Java/jdk8u282-b08/bin;C:/npm/prefix;C:/Program Files/Microsoft SDKs/Azure/Azure Dev Spaces CLI;C:/Program Files/Microsoft SDKs/Azure/Azure Dev Spaces CLI/;C:/Program Files (x86)/Microsoft SDKs/Azure/CLI2/wbin;C:/ProgramData/kind;C:/windows/system32;C:/windows;C:/windows/System32/Wbem;C:/windows/System32/WindowsPowerShell/v1.0/;C:/windows/System32/OpenSSH/;C:/ProgramData/Chocolatey/bin;C:/Program Files/Microsoft/Web Platform Installer/;C:/Program Files/Docker;C:/Program Files/PowerShell/7/;C:/Program Files/dotnet/;C:/Program Files/Microsoft SQL Server/130/Tools/Binn/;C:/Program Files/Microsoft SQL Server/Client SDK/ODBC/170/Tools/Binn/;C:/Program Files (x86)/Windows Kits/10/Windows Performance Toolkit/;C:/Program Files (x86)/Microsoft SQL Server/110/DTS/Binn/;C:/Program Files (x86)/Microsoft SQL Server/120/DTS/Binn/;C:/Program Files (x86)/Microsoft SQL Server/130/DTS/Binn/;C:/Program Files (x86)/Microsoft SQL Server/140/DTS/Binn/;C:/Program Files (x86)/Microsoft SQL Server/150/DTS/Binn/;C:/Program Files/nodejs/;C:/ProgramData/chocolatey/lib/pulumi/tools/Pulumi/bin;C:/ProgramData/chocolatey/lib/maven/apache-maven-3.6.3/bin;C:/Program Files/Microsoft Service Fabric/bin/Fabric/Fabric.Code;C:/Program Files/Microsoft SDKs/Service Fabric/Tools/ServiceFabricLocalClusterManager;C:/Program Files/OpenSSL/bin;C:/Strawberry/c/bin;C:/Strawberry/perl/site/bin;C:/Strawberry/perl/bin;C:/Program Files/Git/cmd;C:/Program Files/Git/mingw64/bin;C:/Program Files/Git/usr/bin;c:/tools/php;C:/Program Files (x86)/sbt/bin;C:/Program Files/TortoiseSVN/bin;C:/SeleniumWebDrivers/ChromeDriver/;C:/SeleniumWebDrivers/EdgeDriver/;C:/Program Files/CMake/bin;C:/Program Files/Amazon/AWSCLIV2/;C:/Program Files/Amazon/SessionManagerPlugin/bin/;C:/Program Files/Amazon/AWSSAMCLI/bin/;C:/Program Files (x86)/Google/Cloud SDK/google-cloud-sdk/bin;C:/Program Files (x86)/Microsoft BizTalk Server/;C:/Users/runneradmin/AppData/Local/Microsoft/WindowsApps;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/Llvm/bin;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/VC/Linux/bin/ConnectionManagerExe;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/Llvm/x64/bin;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/VC/Linux/bin/ConnectionManagerExe
WINDOWS_VS_VER=150
WINDOWS_VS_VC_TOOLS_INSTALL_DIR=C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910
WINDOWS_VS_VC_TOOLS_REDIST_DIR=C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Redist/MSVC/14.28.29910
WINDOWS_SDK_DIR=C:/Program Files (x86)/Windows Kits/10
WINDOWS_SDK_VERSION=10.0.19041.0

Mac

D:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\Build"

Note the use of the double backslash in the VSCOMNTOOLS env var. This is needed because the cygwin shell uses the '\' as an escape character.

If these definitions aren't persisted between launches of Cygwin, you can either set them in the Windows Environment Variables UI or in the /home/$user$/.bash_profile file (these are ran on startup). Use export -p to verify that the env variables are set correctly.

Mac

You will need macOS 12 (MontereyYou will need macOS 10.12 (Sierra) or later.

Install the following software:

  • Xcode 9.114 or later (14.3 is recommended)
  • Xcode developer command line tools – you can install them by using the menus within Xcode: XCode -> Preferences -> Downloads -> Components
  • mercurial (hg)git

If you build WebKit (it is not built by default) you will need the following additional tools:

  • Cmake 3.822.2 3 or later, available from the Cmake download site
  • gperf

...

If you build WebKit (it is not built by default) you will need the following additional tools:

  • Cmake 3.1322.3 or later, available from the Cmake download site
  • bison
  • flex
  • gperf
  • perl (5.10 or later)

  • python3

  • ruby (2.5 or later)

The following should satisfy the requirements (but check the version of cmake) :

...

OpenJFX N is formally compatible with JDK N and N-1. For OpenJFX 1322, download OpenJDK 12 21 or later to use as the boot JDK to build and test OpenJFX. We recommend JDK 13to use the latest version, however, only Gradle 6 supports Java 13 and it is not released yet, so use JDK 12Gradle might not support that version, so a version that Gradle supports might also be required to run Gradle itself (though it will use the latest version of the JDK through toolchain support).

Git

OpenJFX (and OpenJDK) transitioned to Git as part of Project Skara. The OpenJFX repo is hosted on GitHub at openjdk/jfx. We encourage developers to become familiar with Git and GitHub.

...

Gradle is the primary build tool for building OpenJFX. Since the repository includes a Gradle wrapper that will download the correct Gradle version when needed, you do not need to manually install Gradle. The current and minimum Gradle versions are defined in the source code. If you want to generate a wrapper yourself (for example, you want to build OpenJFX with a different Gradle version), then you will need to install Gradle.

The ./gradlew (./ refers to the current directory) sh gradlew command used throughout this document can be replaced with gradle when not using the wrapper.

...

IMPORTANT: Any time you change env settings or install new software after a failed build of JavaFX you should execute the following three commands:

Code Block
sh gradlew --stop
rm -rf build
sh gradlew clean

The first is needed to stop any gradle daemons that might be running (by default gradle starts a daemon that is used to speed up subsequent builds). There was a bug in the gradle daemon that causes gradle to ignore any env variables set after the daemon is started (see JDK-8193288). Additionally, on Windows platforms, the gradle daemon can sometimes interfere with your ability to delete files that it keeps open. If you run into problems you can stop the gradle daemon with "gradlew gradle --stop" (or disable the gradle daemon altogether).

...

Before diving directly into building OpenJFX, lets get our feet wet by learning what kinds of things we can call from the command line, and how to get help when we need it. The first command you should execute is tasks:

Code Block
$ sh ./gradlew tasks
...
:tasks
------------------------------------------------------------
All tasks runnable from root project
------------------------------------------------------------

Default tasks: sdk

Basic tasks
-----------
buildModuleBaseWin - creates javafx.base property files
buildModuleGraphicsWin - copies javafx.graphics native libraries
buildModuleLibsWin
buildModuleMediaWin - copies javafx.media native libraries
buildModuleSWTWin - copies SWT JAR
buildModuleWebWin - copies javafx.web native libraries
clean - Deletes the build directory and the build directory of all sub projects
cleanAll - Scrubs the repo of build artifacts
javadoc - Generates the JavaDoc for all the public API
javafxSwtWin - Creates the javafx-swt.jar for the win target
sdkWin

Build tasks
-----------
assemble - Assembles the outputs of this project.
build - Assembles and tests this project.
buildDependents - Assembles and tests this project and all projects that depend on it.
buildModulesWin
buildModuleWin
buildModuleZipWin
buildNeeded - Assembles and tests this project and all projects it depends on.
buildRunArgsWin
ccWinFont - Compiles native sources for font for win
ccWinGlass - Compiles native sources for glass for win
ccWinIio - Compiles native sources for iio for win
ccWinPrism - Compiles native sources for prism for win
ccWinPrismD3D - Compiles native sources for prismD3D for win
ccWinPrismES2 - Compiles native sources for prismES2 for win
ccWinPrismSW - Compiles native sources for prismSW for win
classes - Assembles main classes.
clean - Deletes the build directory.
cleanNative - Clean all native libraries and objects for Graphics
cleanNativeDecora - Clean native objects for Decora
cleanNativeFont - Clean native objects for font
cleanNativeGlass - Clean native objects for glass
cleanNativeIio - Clean native objects for iio
cleanNativePrism - Clean native objects for prism
cleanNativePrismD3D - Clean native objects for prismD3D
cleanNativePrismES2 - Clean native objects for prismES2
cleanNativePrismSW - Clean native objects for prismSW
createMSPfile
generateD3DHeaders - Generate headers by compiling hlsl files
jar - Assembles a jar archive containing the main classes.
jslcClasses - Assembles jslc classes.
linkWinFont - Creates native dynamic library for font for win
linkWinGlass - Creates native dynamic library for glass for win
linkWinIio - Creates native dynamic library for iio for win
linkWinPrism - Creates native dynamic library for prism for win
linkWinPrismD3D - Creates native dynamic library for prismD3D for win
linkWinPrismES2 - Creates native dynamic library for prismES2 for win
linkWinPrismSW - Creates native dynamic library for prismSW for win
native - Compiles and Builds all native libraries for Graphics
nativeDecora - Generates JNI headers, compiles, and builds native dynamic library for Decora
nativeFont - Generates JNI headers, compiles, and builds native dynamic library for font for all compile targets
nativeGlass - Generates JNI headers, compiles, and builds native dynamic library for glass for all compile targets
nativeIio - Generates JNI headers, compiles, and builds native dynamic library for iio for all compile targets
nativePrism - Generates JNI headers, compiles, and builds native dynamic library for prism for all compile targets
nativePrismD3D - Generates JNI headers, compiles, and builds native dynamic library for prismD3D for all compile targets
nativePrismES2 - Generates JNI headers, compiles, and builds native dynamic library for prismES2 for all compile targets
nativePrismSW - Generates JNI headers, compiles, and builds native dynamic library for prismSW for all compile targets
rcFont - Compiles native sources for font
rcGlass - Compiles native sources for glass
rcIio - Compiles native sources for iio
rcPrism - Compiles native sources for prism
rcPrismD3D - Compiles native sources for prismD3D
rcPrismES2 - Compiles native sources for prismES2
rcPrismSW - Compiles native sources for prismSW
shadersClasses - Assembles shaders classes.
shimsClasses - Assembles shims classes.
stubClasses - Assembles stub classes.
testapp1Classes - Assembles testapp1 classes.
testapp2Classes - Assembles testapp2 classes.
testapp3Classes - Assembles testapp3 classes.
testapp4Classes - Assembles testapp4 classes.
testapp5Classes - Assembles testapp5 classes.
testapp6Classes - Assembles testapp6 classes.
testClasses - Assembles test classes.
toolsClasses - Assembles tools classes.

Build Setup tasks
-----------------
init - Initializes a new Gradle build.
wrapper - Generates Gradle wrapper files.

Documentation tasks
-------------------
javadoc - Generates Javadoc API documentation for the main source code.

Help tasks
----------
buildEnvironment - Displays all buildscript dependencies declared in root project 'rt'.
components - Displays the components produced by root project 'rt'. [incubating]
dependencies - Displays all dependencies declared in root project 'rt'.
dependencyInsight - Displays the insight into a specific dependency in root project 'rt'.
dependentComponents - Displays the dependent components of components in root project 'rt'. [incubating]
help - Displays a help message.
model - Displays the configuration model of root project 'rt'. [incubating]
projects - Displays the sub-projects of root project 'rt'.
properties - Displays the properties of root project 'rt'.
tasks - Displays the tasks runnable from root project 'rt' (some of the displayed tasks may belong to subprojects).

Publishing tasks
----------------
generateMetadataFileForJavafxPublication - Generates the Gradle metadata file for publication 'javafx'.
generateMetadataFileForMavenPublication - Generates the Gradle metadata file for publication 'maven'.
generatePomFileForJavafxPublication - Generates the Maven POM file for publication 'javafx'.
generatePomFileForMavenPublication - Generates the Maven POM file for publication 'maven'.
publish - Publishes all publications produced by this project.
publishJavafxPublicationToMavenLocal - Publishes Maven publication 'javafx' to the local Maven repository.
publishJavafxPublicationToMavenRepository - Publishes Maven publication 'javafx' to Maven repository 'maven'.
publishMavenPublicationToMavenLocal - Publishes Maven publication 'maven' to the local Maven repository.
publishMavenPublicationToMavenRepository - Publishes Maven publication 'maven' to Maven repository 'maven'.
publishToMavenLocal - Publishes all Maven publications produced by this project to the local Maven cache.

Verification tasks
------------------
check - Runs all checks.
test - Runs the unit tests.
To see all tasks and more detail, run gradle tasks --all
To see more detail about a task, run gradle help --task <task>

BUILD SUCCESSFUL in 19s
1 actionable task: 1 executed

...

Gradle then tells us what the default tasks are. In this case, our default task is the 'sdk' task. This is the task that will be executed if you just call 'gradle' alone without providing any additional arguments. After this comes a listing of different tasks, broken out by group. The first group is the "Basic" group which contains the tasks you may find yourself using most often. These are all named and have a description provided. For example, if I wanted to execute executing the 'clean' task , then I would do so would be done like this:

Code Block
$ ./sh gradlew clean

Finally, the tasks task gives us a useful hint that we can pass the --all argument in order to see all of the tasks in more detail. This produces a lot more output, but really gives an in depth look at what tasks are available for you to call.

I As mentioned above that our , the root project is called "rt", and that we have sub-projects in the gradle build. To see all of the projects available to you, execute the the projects task (which you will notice was in the "Help tasks" group produced by the tasks task). This lists not just what projects are available, but what their name is, and what the project hierarchy is.

Code Block
$ sh ./gradlew projects
...
:projects
------------------------------------------------------------
Root project
------------------------------------------------------------
Root project 'rt'
+--- Project ':apps'
+--- Project ':base'
+--- Project ':controls'
+--- Project ':fxml'
+--- Project ':graphics'
+--- Project ':media'
+--- Project ':swing'
+--- Project ':swt'
+--- Project ':systemTests'
\--- Project ':web'
To see a list of the tasks of a project, run gradle <project-path>:tasks
For example, try running gradle :apps:tasks
BUILD SUCCESSFUL in 1s
1 actionable task: 1 executed

...

The simplest basic task to build is the sdk task. The sdk task will compile all Java sources and all native sources for your target platform. It is the default task which is executed if you do not supply a specific task to run. It will create the appropriate sdk directory and populate it with the native dynamic libraries and the jfxrt.jar. Because the SDK is not distributed with documentation, the javadocs are not created as part of the sdk task by default. Once the sdk task has completed, you will have and SDK distribution which you could run against or give to somebody else to run.

Code Block
$ ./sh gradlew
...
:buildModulesLinux
:buildRunArgsLinux
:buildModules
:createTestArgfilesLinux
:sdkLinux
:sdk
BUILD SUCCESSFUL in 1m 48s
127 actionable tasks: 127 executed

...

By default, the OpenJFX build system will only build the SDK for the desktop platform you are building from. To ask it to build for a specific compile target, you must pass a COMPILE_TARGETS property to the build system, instructing it which to build. This is a comma separated list. Assuming you have already setup the prerequisites for building ARM (for example, when targeting the Raspberry PI), you would invoke gradle like this:

Code Block
$ sh ./gradlew -PCOMPILE_TARGETS=armv6hf

...

The next basic task which you may want to perform is test. The test task task will execute the unit tests . You generally will execute the top level test because unlike with Ant, Gradle will only re-execute those tests which have changed (or were dependent on code that was changed) on subsequent runs. You can of course execute gradle cleanTest in order to clean all the test results so they will run fresh. Or, if for all projects (all modules). If you want to execute only those tests related to a single project, you can do so in the normal fashion:

Code Block
$ ./sh gradlew :base:test
The CompileOptions.useAnt property has been deprecated and is scheduled to be removed in Gradle 2.0. There is no replacement for this property.
:base:processVersion UP-TO-DATE
:build-tools:generateGrammarSource UP-TO-DATE
:build-tools:compileJava UP-TO-DATE
:build-tools:processResources UP-TO-DATE
:build-tools:classes UP-TO-DATE
:build-tools:jar UP-TO-DATE
:base:compileJava UP-TO-DATE
:base:processResources UP-TO-DATE
:base:classes UP-TO-DATE
:base:compileTestJava UP-TO-DATE
:base:processTestResources UP-TO-DATE
:base:testClasses UP-TO-DATE
> Building > :base:test > 3411 tests completed, 45 skipped

...

When running a system test that requires the Robot API, additional flags need to be passed:

Code Block
./sh gradlew cleanTest -PFULL_TEST=true -PUSE_ROBOT=true :systemTests:test --tests TestClassName

...

Overview
Content Tools
ThemeBuilder

Terms of Use
• License: GPLv2
• Privacy • Trademarks • Contact Us

Powered by a free Atlassian Confluence Open Source Project License granted to https://www.atlassian.com/software/views/opensource-community-additional-license-offer. Evaluate Confluence today.

  • Kolekti ThemeBuilder Powered by Atlassian Confluence 8.5.23
  • Kolekti ThemeBuilder printed.by.atlassian.confluence
  • Report a bug
  • Atlassian News
Atlassian
Kolekti ThemeBuilder EngineAtlassian Confluence
{"serverDuration": 282, "requestCorrelationId": "3fba29d7bab813d3"}