What is the JavaFX Runtime?
The documentation often says the "JavaFX runtime" does XY in the background, but what is "runtime"? If I understand correctly (please edit) the runtime is composed of the following parts:
- all classes, etc. JavaFX frameworks located in the javafx package and stored in the jxfrt.jar file.
- stream 'JavaFX-Launcher'
- JavaFX Appliaction Thread: All objects and threads launched by your JavaFX application. They are created by the JavaFX-Launcher thread when the Appplication.launch () method is called.
My question is what is lead time?
source to share
J Woodchucks answer to addresses, Java 8, this answer simply addresses Java 9+ .
For JRE 9+ jfxrt.jar
does not exist and is replaced by .jmods
in the catalog <JRE_HOME>/jmods
. This was done as part of the JDK modularization . Additional required native libraries for JavaFX are included in the catalog <JRE_HOME>/lib
. JavaFX won't work without the required built-in libraries.
You can use the full JRE provided by a vendor such as Oracle (and possibly a third-party OpenJDK vendor such as Ubuntu package or Redhat JRE). This will include all the necessary modules and libraries to run JavaFX, as well as some of them that are part of the JRE but do not need to run a JavaFX application.
Note. For Java 8, some OpenJDK developers have chosen not to include the JavaFX runtime as part of their Java distributions, requiring either the installation of an additional OpenJDK build package or switching to a java runtime that includes JavaFX (such as the Oracle JRE). Hopefully, for Java 9, all OpenJDK vendors will provide the full JRE runtime including JavaFX, but you may have to wait until the OpenJDK vendors release publicly available Java 9 runtimes to find out.
You can create a custom modular JavaFX runtime with Java 9 that excludes some JRE modules that your application might not need. A custom modular runtime for JavaFX requires the javafx.*
modules you want to use, any dependent modules of those modules, and any required native libraries. You can package your JavaFX application with a custom runtime using JavaFX packager . The JJK 9 javafxpackager packaging technique is based on the Java 9 modular system; the internal implementation of which uses java linker .
The Java wrapper can optionally package the custom runtime as part of a standalone application to install the package (if desired). A stand-alone application contains your Java or JavaFX application, and the JRE contains your application to run.
Once Java 9 gets its general availability release, I'm sure Oracle will provide additional official documentation and samples that demonstrate how to create a custom modular runtime for a JavaFX application and use it as part of a standalone application.
In addition, third party vendors such as gluon provide tools for batch applications with custom JavaFX scripts on various devices such as iPads and Android phones.
source to share
The time referenced by JavaFX is the jar jfxrt.jar
you mention. It contains the libraries required for JavaFX, including the JavaFX launcher thread (LauncherImpl in the com.sun.javafx.application package) and Application . Location jfxrt.jar
(whether you have a JDK or JRE):
- For Java 7 under jre \ lib
- For Java 8 under jre \ lib \ ext
I don't see the LauncherImpl registered in the Oracle javadoc, so linked to the OpenJDK version above.
source to share