5

I tried to compile the JavaFX HelloWorld demo form Oracle on Ubuntu 16.04.3 LTS with OpenJDK 9, but it did not work:

$ javac -version
javac 9-internal
$ javac HelloWorld.java
HelloWorld.java:3: error: package javafx.application does not exist
...

I can't find an OpenJFX package for Java 9 in the package manager. The one that exists only works for OpenJDK 8 (I tried installing it anyway, but it did not help):

$ apt-cache search openjfx
...
openjfx - JavaFX/OpenJFX 8 - Rich client application platform for Java
...

Do I have to install JavaFX from source to compile JavaFX applications with OpenJDK 9 on Ubuntu?

fabian
  • 80,457
  • 12
  • 86
  • 114
user11171
  • 3,821
  • 5
  • 26
  • 35
  • [`javafx.application`](https://docs.oracle.com/javase/9/docs/api/javafx/application/package-summary.html) is there in the JDK. Not sure what version of the JDK are you exactly facing this with though. – Naman Jan 01 '18 at 17:45
  • I think the issue is that Debian builds don't include the JavaFX modules. I don't know if Debian provide an alternative download / deb or not. An alternative is of course to use the Oracle JDK download as it includes the JavaFX modules. – Alan Bateman Jan 02 '18 at 07:32
  • @AlanBateman I think you are right, I didn't find a JavaFX package in the default apt repos. It's strange since they provided JavaFX packages for Java 8. – user11171 Jan 02 '18 at 12:12

0 Answers0