JavaFX missing from JDK 1.7/1.8 in Linux? JavaFX missing from JDK 1.7/1.8 in Linux? linux linux

JavaFX missing from JDK 1.7/1.8 in Linux?


Currently in Debian and Ubuntu (probably others) JavaFX is a separate package from the OpenJDK (openjdk-8-jdk) and so needs to be installed:

sudo apt-get install libopenjfx-java libopenjfx-java-doc

Notable issue (this issue does not impact a Maven, JavaFX application so if that is your preferred build method then ignore the following issue):

If you try to create a new project: Categories > JavaFXProject > JavaFXApplication

You'll get:

Internal error. Missing resources [/resources/web-files/javafx-loading-100x100.gif] /home/ken/NetBeansProjects/vestFxReports/nbproject/jfx-impl.xml:1465: The following error occurred while executing this line: /home/ken/NetBeansProjects/vestFxReports/nbproject/jfx-impl.xml:3093: The following error occurred while executing this line: /home/ken/NetBeansProjects/vestFxReports/nbproject/jfx-impl.xml:2055: Error: -includedt requires the java deployment toolkit, which is not included in this distribution BUILD FAILED (total time: 1 second)

To fix the above error [following steps are derived from here: http://hongouru.blogspot.com.uy/2015/09/solved-error-building-new-project-using.html]:

  1. Switch to the files tab (usually you're on the Project tab).
  2. Expand the node for your project >expand the nbproject node > open the "project.properties" file.
  3. Find the line javafx.deploy.includeDT=true and change true to false.

Now you can create and run a JavaFX application, on OpenJDK.


Next steps, although beyond the issue at hand you'll probably at some point want to download the JavaFX scene builder: http://www.oracle.com/technetwork/java/javafxscenebuilder-1x-archive-2199384.html


Apparently, the issue is indeed a discrepancy between the open-source OpenJDK provided by most Linux distributions, and the proprietary Oracle JDK. Ironically, this is a well-known issue, but you have to specifically search for it to find it, and by then you already know.

The solution is to download the official Oracle JDK, and if necessary create the matching platform in NetBeans (located under /usr/java/jdk... at this moment). It should work perfectly fine after that.