Eclipse Version: 2018-12 (4.10.0)
JDK Version 11.0.2
Windows 64
First of all, the official documentation for JavaFX,
, is very detailed, and this article does not follow it exactly.
Download an appropriate JavaFX runtime Download an appropriate JavaFX runtime extract to folder (location not fixed but remember path), for example:
D:\openjfx-11.0.2_windows-x64_bin-sdk\javafx-sdk-11.0.2"
”
2. Ecliplse has been downloaded by default and Java11.0.2 development environment has been configured. Note that since Java11, the JDK and javaFX have been separated (there is no jre package for javaFX in the JDK after exporting the jre folder from the command line), so you don’t have to download a e(fx)clipse
plug-in to use, you have to download and add it manually.
3. Create a User Library according to the official document. Include the jre under lib in the JavaFX runtime file downloaded before
Eclipse -> Window -> Preferences -> Java -> Build Path -> User Libraries -> New
next name is arbitrary, you can find the added FX lib in the Library when creating the project
4. Create a Java project, need three files, (someone else’s Github project link), and import a custom Library path.
5. The following problem occurs in the runtime. The solution mentioned in the official document is to add VM parameters
run-& gt; Run Configurations... code> select Main. Java is the Main class also click the Arguments TAB you can see the Arguments of the VM option, add the following parameters
- the module - the path "/ path/to \ \ lib" deployment headaches - SDK - 11 - add - modules deployment headaches. Controls, deployment headaches. FXML code>
Here, the path, to 11 \ lib \ deployment headaches - SDK - parameter is the path of the openjfx before download file decompression, such as
- the module - path "D: \ eclipse \ openjfx - 11.0.2 _windows x64_bin - SDK \ deployment headaches - SDK - 11.0.2 \ lib" - add - modules deployment headaches. Controls, deployment headaches. FXML code>
The successful running
The import Javafx cannot be resolved
JavaFX Runtime Components are missing, and are required to run this application
Problem 3. Error: The Main class Application.main cannot be initialized
As for the first problem, it is probably due to the
problem caused by running javaFX in the way of installing plug-ins when Java11 JDK and javaFX are separated at the beginning. If there is a problem with the import of Library package, check the path or go directly into the path to see if all of these jre files exist.
Read More:
- JavaFX 11: “missing JavaFX runtime component”
- After eclipse eclipse eclipse imports the correct project, an error is reported in XML and other files
- Eclipse startup error: a Java runtime environment (JRE) or Java Development Kit (JDK) must be available
- Eclipse specifies JDK version to start, and resolves version XXXX of the JVM is not suitable
- How to Fix Error: JavaFX cannot find fxml
- The problem of MAC switching JDK version and RN Android JDK version leads to compilation failure. Solve it
- Error loading in flex integration: Java / jdk1.6.0_ 35\jre\bin\server\ jvm.dll
- Eclipse: unable to open editor: no ID org.eclipse.jdt . ui.CompilationUnitEditor Editor descriptor for
- Options – Xverify:none and -Noverify were decoded in JDK 13 solution
- Modifying SVN user name and password in eclipse
- Error when opening jeesite project in eclipse
- Using jmh in eclipse
- eclipse cdt Program “make” not found in PATH
- Solution to the error of @ resource annotation in eclipse spring
- Access restriction in Eclipse: the type ‘xxx’ is not API solution
- What did project > clean do in eclipse
- The solution to “polling news feeds” appeared in Eclipse in Java
- About the error of base64decoder reference in eclipse
- @Solution to get / set error in eclipse after using data annotation
- Eclipse PyDev “interpreter does not exist in filesystem”