OpenJDK for Java 8 could include JavaFX (as JavaFX for Java 8 is now open source), but it will depend on the OpenJDK package assemblers as to whether they choose to include JavaFX 8 with their distributions. So using Oracle Java 8 is currently the best solution to your issue.
This means that JavaFX classes will automatically be found both by the compiler during the build and by the runtime when your users use your application. With Oracle Java 8, JavaFX is both included in the JDK and is on the default classpath. I don't run Debian, so I'm not sure where the Debian OpenJFX package installs jfxrt.jar.
To install this package it is necessary to install both the Debian OpenJDK 8 package and the Debian OpenJFX package. Jfxrt.jar is not in the Linux OpenJDK 7 (which is what you are using).Īn open source package which provides JavaFX 8 for Debian based systems such as Ubuntu is available. The will depend on where you installed the Oracle Java and may differ between Linux distributions and installations. The location of jfxrt.jar in Oracle Java 8 is: /lib/ext/jfxrt.jar The location of jfxrt.jar in Oracle Java 7 is: /lib/jfxrt.jar
With versions 11+ of JavaFX, the location of the JavaFX jar files (and the native libraries to accompany them) will depend on how you build your project.
JavaFX has been partitioned into a set of dependencies rather than a monolithic jfxrt.jar library distributed with the Java runtime (as was previously the case with Oracle Java 8 for instance). JavaFX is now available from openjfx.io or the public Maven repository as an SDK or a library set, or a module set.
This update provides info for more recent versions. The previous information in this answer is now obsolete for later versions of Java and JavaFX (e.g.