JavaFX and OpenJDK
I'm trying to decide whether I could switch to JavaFX for the user interface of my Java application. Most of my users would be using the Oracle JRE, which has JavaFX integrated these days. However, some are using OpenJDK (on linux). This (old) question suggests that OpenJDK deals very badly with JavaFX. According to this question, the alternative OpenJFX will only be fully integrated into OpenJDK in version 9. So my question is twofold:
- Is the JavaFX support in OpenJDK still so bad?
- If so, are there any Linux distributions that already offer an OpenJFX package so users wouldn't have to build it themselves?
JavaFX comes with JDK 8?, in JDK 8 will continue through at least 2022. JavaFX 14 OpenJFX is an open source, next generation client application platform for desktop, mobile and embedded systems built on Java. It is a collaborative effort by many individuals and companies with the goal of producing a modern, efficient, and fully featured toolkit for developing rich client applications.
For me this worked.
$ sudo apt-get install openjfx
JavaFX will be removed from the Java JDK, part of the OpenJDK under the OpenJFX project, in order to increase the pace of its development. OpenJFX Project. OpenJFX is the open source home of JavaFX development. The goal of OpenJFX is to build the next-generation Java client toolkit. This Project is sponsored by the Swing Group. OpenJFX Home Page. OpenJFX Wiki – The main page of the OpenJFX Wiki is the home page for the project. Go there for status, source code repositories
cp <JRE_WITH_JAVAFX_HOME>/lib/ext/jfxrt.jar <JRE_HOME>/lib/ext/ cp <JRE_WITH_JAVAFX_HOME>/lib/javafx.properties <JRE_HOME>/lib/ cp <JRE_WITH_JAVAFX_HOME>/lib/amd64/libprism_* <JRE_HOME>/lib/amd64/ cp <JRE_WITH_JAVAFX_HOME>/lib/amd64/libglass.so <JRE_HOME>/lib/amd64/ cp <JRE_WITH_JAVAFX_HOME>/lib/amd64/libjavafx_* <JRE_HOME>/lib/amd64/
just make sure you have the gtk 2.18 or higher
JavaFX, currently JavaFX libraries are missing from the OpenJDK 8 Windows Distributions. Is there a plan to include JavaFX in the AdoptOpenJDK Unfortunately, found out that org.openjfx.javafxplugin cannot be used with OpenJDK 8 and then I reached this topic to find out, that JavaFX is not bundled with OpenJDK 8. I am currently looking into compiling org.openjfx.javafxplugin against OpenJDK 8 (openjfx/javafx-gradle-plugin#61). So, any progress on this?
Also answering this question:
Where can I get pre-built JavaFX libraries for OpenJDK (Windows)
On Linux its not really a problem, but on Windows its not that easy, especially if you want to distribute the JRE.
You can actually use OpenJFX with OpenJDK 8 on windows, you just have to assemble it yourself:
Download the OpenJDK from here: https://github.com/AdoptOpenJDK/openjdk8-releases/releases/tag/jdk8u172-b11
Download OpenJFX from here: https://github.com/SkyLandTW/OpenJFX-binary-windows/releases/tag/v8u172-b11
copy all the files from the OpenFX zip on top of the JDK, voila, you have an OpenJDK with JavaFX.
Fortunately from Azul there is now a OpenJDK+OpenJFX build which can be downloaded at their community page: https://www.azul.com/downloads/zulu-community/?&version=java-8-lts&os=windows&package=jdk-fx
JavaFX is missing in OpenJDK 8 Distributions · Issue #577 , OpenJFX is the open source home of JavaFX development. The goal of OpenJFX is to build the next-generation Java client toolkit. This Project is sponsored by This is the open source project where we develop JavaFX. OpenJFX is free software, licensed under the GNU General Public License with Classpath Exception , just like the JDK Project. Anybody is welcome to contribute to this project, port it to other platforms or devices, or do anything else that a free software license allows you to do!
There is need to modify these scripts (contains error and don't exactly do the "thing" required), i will upload mine scripts forked from obuildfactory in next few days. and so i will also update my answer accordingly.
Until then enjoy, sir :)
OpenJFX Project, This is the open source project where we develop JavaFX. OpenJFX The OpenJFX Project is part of the OpenJDK open-source Community. OpenJFX. OpenJFX is an open source, next generation client application platform for desktop, mobile and embedded systems based on JavaSE. It is a collaborative effort by many individuals and companies with the goal of producing a modern, efficient, and fully featured toolkit for developing rich client applications.
Main - OpenJFX, Since JDK version 9, JavaFX (JFX) is provided as a separate package. This document explains how to install the OpenJDK version 12 along Note: JavaFX, JFR, and JMC were all contributed by Oracle to the OpenJDK project for releases after Java 8. IcedTea-Web. Java Web Start was deprecated by Oracle in Java SE 8 and removed in Java SE 9.
OpenJDK and OpenJFX Installation Guide, This release proves there is a great future for client-side Java development. As an OpenJDK Project , OpenJFX shares much of its principles and infrastructure, Before JDK version 9, JavaFX libraries were included in the JDK distribution. Since JDK version 9, JavaFX (JFX) is provided as a separate package. This document explains how to install the OpenJDK version 12 along with OpenJFX libraries for the following operating systems:
JavaFX, JavaFX 11 does crash with OpenJDK 11 on Ubuntu 18.04 Linux PCs with the Wayland window server enabled. Use of the Xorg server is In the Ubuntu 16.04 and later default repositories JavaFX is packaged as a separate package named openjfx. To install it in Ubuntu 18.04, open the terminal and type: sudo apt install openjdk-8-jdk openjfx
- What is the execution mode of your application (how is it deployed?)
- @jewelsea It runs as a standalone program.
- @docM would it be a solution to switch to the oracle-(sun)-jdk for the ubuntu machines? webupd8.org/2012/01/…
- @nyyrikki That is an option. But I'd rather stick with Java Swing if JavaFX and OpenJDK don't mix.
- @Yngve I ported everything to JavaFX when Ubuntu and Debian started including the packages.
- @Emmanuel, Thanks for your work on this. JavaFX is part of the JDK, so (at least until the JDK becomes modularized) I'm not sure why there would be a separate OpenJFX package instead of including all of the necessary runtime files in the standard OpenJDK package (as is done with the Oracle JDK distributions). The open-jfx mailing list would be a good place if further discussion is required.
- A separate package gives a degree of flexibility if someone is interested in the JDK but not in JavaFX. Isn't modularization an objective for Java 9 after all? :)
- "Currently this is not being done, but I would be quite surprised if Java 8 Linux packages did not include JavaFX when Java 8 is released in March 2014". You must be surprised as OpenJDK 8 doesn't include OpenJFX.
- Arch Linux also has packages for openjfx: archlinux.org/packages/?name=java-openjfx
- @NoBugs This may be a little too late a response to be useful, but Ubuntu 14.04 doesn't include OpenJDK 8, which is why you can't find the corresponding JFX package. I can't recall which Ubuntu release introduced it, but it is definitely available in Ubuntu 16.04 - together with the "openjfx" package.
- Probably the easiest way to add JavaFX to your Linux JDK