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?

jww
  • 97,681
  • 90
  • 411
  • 885
Dang
  • 51
  • 1
  • 3

1 Answers1

6

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.

jkoshy
  • 1,793
  • 15
  • 23