Skip to content
Advertisement

Jar doesn’t execute on linux

I exported an executable Jar file from Eclipse. On Windows when I double-click the file, it executes properly. When I run it from command line with java -jar MyJar.jar it also works. But when I upload that file on my linux VPS and try to run it there, I just get the error

Error: Could not find or load main class mypackage.MyClass

I tried many things like changing CLASSPATH, trying out different Class-Paths and Main-Classes in the MANIFEST.MF file, and even trying to execute the program from .class files without the jar container. But unfortunately nothing works.

Do you have any ideas? Or did you face the same problem?

EDIT:
Manifest:

Manifest-Version: 1.0
Class-Path: .
Main-Class: mypackage.MyClass

Name: about.html
SHA-256-Digest: 1fuYr0bu6NsJZCAmSom5QtnvnV0Cg8DwLn77Dd1Ql24=

Name: jfx8.cssext
SHA-256-Digest: b2p9PXeoxqnTdYgBFeKp3s7J9PajukOS3sGqyM4s36I=

Advertisement

Answer

I finally solved my problem!!

The problem was that no JavaFx runtime was installed on the VPS. Don’t know why that caused that error. I rewrote the Application without JavaFx and now it works.

Thank you for all your help.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement