I'm trying to make the JavaFX application I made on Windows work for Ubuntu. I've made the .jar file and it works fine on Windows 10, but won't work on Ubuntu. Whether I double click it from the desktop (with running as executable enabled) or run it from the terminal, I keep getting some form of the error that it can't find my Main class. Javac also doesn't work, getting the same kind of error there. This is my MANIFEST file:
Manifest-Version: 1.0
Implementation-Title:
Implementation-Version:
Permissions: sandbox
JavaFX-Version: 8.0
Class-Path:
Created-By: JavaFX Packager
Implementation-Vendor:
Main-Class: Main
I have installed Java using the apt install default-jre
command. Any ideas?
This is the error I get on running java -jar myApp.jar
:
Could not find or load main class Main
Caused by: java.lang.NoClassDefFoundError: javarx/application/Application
After installing javafx, which is necessary as some people pointed out, it still doesn't work. Running the java
command gives the same (see above). Here are some examples of running the javac
command:
javac myApp.jar
or javac myApp
error: Class names, 'myApp.jar', are only accepted if annotation processing is explicitly requested
javac -cp myApp.jar
or javac -cp myApp
javac: no source files
sudo apt install openjfx