Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I've developed a program in Windows with Java(FX) using Intellij Idea and that worked just fine, I then exported the artifact (jar) and there was no problem running it on Windows (both with the console and double clicking it).

I've then copied it to my Ubuntu VM, but there it says

Error: Could not find or load main class sample.Main

This is the Manifest:

Manifest-Version: 1.0
Main-Class: sample.Main

The JAR file structure looks like this:

test.jar
--- META-INF
--- --- MANIFEST.MF
--- org
--- --- json
--- --- --- // json library
--- sample
--- --- Contacts.class
--- --- Controller.class
--- --- Main.class
--- --- sample.fxml
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
361 views
Welcome To Ask or Share your Answers For Others

1 Answer

Ubuntu, like Debian, has a separate package for OpenJFX (OpenJDK's implementation of JavaFX). Why this is the case, when JavaFX is an integral part of the JRE - I do not know, but your problem should be solved by installing the OpenJFX package:

# aptitude install openjfx  

(or using any other package manager), or by using Oracle's JRE.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...