Reputation: 1
Ok...
I downloaded the .zip and unzipped it.
I put the content in the subfolder /lib directly under my working map.
I typed: import javafx.application.Application; in a file together with a simple hello world - and called the fil GUI.java
I opened the terminal and navigated to the folder.
...and a dozen of other combinations to set the classpath to include the javafx -jars All i get is:
GUI.java:2: error: package javafx.application does not exist
What is wrong?
I'm using Java 11.0.5, Ubuntu and Emacs.
Upvotes: 0
Views: 567
Reputation: 15673
The JFX SDK you downloaded contains .jar
files. You need to put those jars (or at least the ones you need) on the classpath, not the directory containing them. So for example for javafx.application.Application
you’d need -classpath lib/javafx.graphics.jar
.
Alternatively, you could use Java's module system with something like
javac --module-path lib --add-modules javafx.graphics GUI.java
Upvotes: 2