5

I have the following installed on Ubuntu 18.04.1 LTS:

openjdk version "10.0.2" 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.1)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.1, mixed mode)

javafx.runtime.version=8.0.161
javafx.runtime.build=b00

However I try to run the sample java application that uses javafx I get the following error:

$ java -jar Untitled.jar 
Error: JavaFX runtime components are missing, and are required to run this application

I have tried to run it in Eclipse, Intelli, and in the terminal with the same error.

I have set the classpath

:~$ echo $CLASSPATH
/usr/share/java/openjfx/jre/lib/ext/jfxrt.jar:.

I have copied all of the javafx files to the current directory. I have tried everything I can find on the internet.

Does anyone know how to fix this?

3
  • Have you run sudo apt-get install openjfx? See here: stackoverflow.com/questions/18547362/javafx-and-openjdk Commented Sep 1, 2018 at 18:54
  • Yes I have installed openjfx Commented Sep 3, 2018 at 11:57
  • 2
    Try this: java --module-path /<path>/javafx-sdk-11/lib/ --add-modules=javafx.controls -jar Untitled.jar Commented Oct 2, 2018 at 9:15

1 Answer 1

7

On Ubuntu 18.04 with openjdk-11-jre and openjfx installed you could use:

% java --module-path /usr/share/openjfx/lib --add-modules ALL-MODULE-PATH \
    -jar Untitled.jar

There is more information on how to run JavaFX programs at the openjfx.io site.

Sign up to request clarification or add additional context in comments.

1 Comment

FYI: for the JavaFX it's enough only two modules --add-modules javafx.fxml,javafx.controls instead of ALL-MODULE-PATH

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.