3

I am on Ubuntu 19.04. Trying to run a JavaFX project in NetBeans 11.0. I am getting this message error when I want to create a new JavaFX project: The JDK you are using does not support JavaFX I am using JDK 11 and it seems that there is a problem with installing JDK 8 as you can see here: https://launchpad.net/~webupd8team/+archive/ubuntu/java I also read that JavaFX is out of JDK 11.

Could someone guide me to how I can run my JavaFX project?

Nano
  • 57
  • 1
  • 9
  • You need to install JavaFX https://stackoverflow.com/questions/54075707/ubuntu-18-10-how-to-install-javafx-with-java – vladwoguer Apr 19 '19 at 19:58
  • See: [Netbeans 9.0 with JavaFx 11 and JDK 11](https://stackoverflow.com/questions/52533835/netbeans-9-0-with-javafx-11-and-jdk-11) – Jacob G. Apr 19 '19 at 19:58
  • @vladwoguer as it's mention in that answer that I have to install JDK 8. it's problematic somehow as I mentioned above. – Nano Apr 19 '19 at 20:01
  • @Kashan why not use the open jdk: `sudo apt install openjdk-8-jdk openjfx` – vladwoguer Apr 19 '19 at 20:03
  • @vladwoguer got this: E: Unable to locate package openjdk-8-jdk – Nano Apr 19 '19 at 20:13
  • If you're using Java 11 and JavaFX 11, then forget about Java 8. You need to pull in JavaFX as an external dependency, just like any external dependency. See [Getting Started with JavaFX 11](https://openjfx.io/openjfx-docs/). – Slaw Apr 19 '19 at 20:14
  • I agree with @Slaw, no need to install Java 8 if you want to use Java 11. If you want to install the JDK 8 anyway `sudo add-apt-repository ppa:openjdk-r/ppa` then try to install again. – vladwoguer Apr 19 '19 at 20:19
  • True java 8 didn't solve my problem. Now I will try @Slaw solution – Nano Apr 19 '19 at 20:33
  • @vladwoguer OP is using Ubuntu 19.04. Ubuntu has removed OpenJDK 8 from its official repositories. Moreover openjdk-r haven't ported JDK for 19.04 yet. **Kashan**: [Cross-posting is discouraged in SE network](https://meta.stackexchange.com/q/64068). This question was [posted on Ask Ubuntu](https://askubuntu.com/q/1135289/816190) as well. – Kulfy Apr 19 '19 at 20:54
  • @Kulfy sorry for the cross-posting. Thought it's more specific. Anyway, thanks for the information – Nano Apr 19 '19 at 21:13
  • Have you installed netbeans via snap or ubuntu-make or downloaded a zip from its website? – Kulfy Apr 19 '19 at 21:16
  • the problem is am not sure 100%. As far as I remember I installed it using ubnutu software center – Nano Apr 19 '19 at 21:24
  • Do you see netbeans if you run `snap list`? – Kulfy Apr 19 '19 at 21:26
  • yes I do. Hope that helps – Nano Apr 19 '19 at 21:35

1 Answers1

1

You should install java-fx-sdk import it as a library, next create a simple java project and create java class with fxml file.

Nooriallah
  • 11
  • 1