0

I have a weird problem. I have a .jar file that I need to run but when I run it on my Windows PC it works but when I run it on my Ubuntu server it doesn't work. I've installed default-jre on the Ubuntu machine and when I run it by java -jar {my name of file} it says this:

Error: Could not find or load main class {name of the class that is missing} Caused by: java.lang.NoClassDefFoundError: javafx/application/Application.

I've also installed openjfx and openjfx-source using apt-get install so:

apt-get install openjfx
apt-get install openjfx-source

My Windows java version: java version "1.8.0_181" Java(TM) SE Runtime Environment (build 1.8.0_181-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)

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

1 Answers1

0

I've found why it didn't work. The application was build to run on Java 8 and I've installed Java 11 on it. Now it works perfectly with Java 8.