Issue
I'm new in Apache Netbeans 11 with JDK11, however i've been programming in jdk1.8 (netbeans 8.2) for a while but for school purposes i'm forced to use jdk11 this year, the problem is that I dont know, how to create new JavaFX FXML project. I've done some research and found out, that jfx is not a part of standard jdk anymore.
Then I found some tutorials how to run a javafx 11 project with adding the libraries, however it doesn't tell how to create a new project.
Is there any simple way how to add JavaFX 11 to my netbeans so the netbeans can use JavaFX 11 natively (I mean for example create new JavaFX 11 project with jdk11)
And if there isn't and I will have to use jdk 1.8, do I also need to install older Scene Builder or the SB11 will do the work (even for older javafx/jdk?
Solution
Ok, SOLVED:
As you can read in https://openjfx.io/openjfx-docs/#IDE-NetBeans OpenJFK docs, there are basicly many options to create openJFX project (either with FXML)
- From IDE: That means that you have to add libraries, VM options, etc yourself for each project (As I mentioned in my question, not much user friendly solution I was looking for)
- Create Maven Project
- Create Gradle Project
I chose the Maven, yet I have had an errors telling me Unrecognized option: --module-path Command execution failed., altho I have had java_home set up on jdk11 and project on jdk11 as well. However, i needed to add system enviromental variable %JAVA_HOME% with jdk with higher priority then the old one. After that it still didnt run! BUT... Then I deleted the old system EV refferencing on jdk1.8. Since then the project runs with no errors. I tried to create EV refferencing the old jdk1.8 at the end of that Path list and it still run. (So there was a bug with prioritising the Paths I guess) Thank you all, espcly @JoséPereda
Sum – all steps I've done to solve Unrecognized option: --module-path Command execution failed.
- Set Apache NetBeans etc/netbeans.conf -> netbeans_jdkhome=/path/to/jdk-11
- Create a new System Enviromental Variable called JAVA_HOME with value of path to new jdk (jdk11 in my case)
- Edit System Enviromental Variable Path -> New -> %JAVA_HOME%\bin and move it above your old jdk path (yet my Maven project didn't run after this step)
- Remove the old jdk path (jdk1.8 in my case)
- Restart Apache NetBeans 11 -> Run Project -> It runs with no erros
- I tried to add my old System Enviromental Varible Path (refferencing jdk1.8) and it still works.
Answered By - PattysFall
Answer Checked By - Marie Seifert (JavaFixing Admin)