Opening JavaFX jar on Ubuntu [SOLVED]
-
I've created a JavaFX project, and exported it as Runnable Jar (with Eclipse). On Windows it works just fine, it opens up, and it does everything I made it do. The problem is when I try to run it on Ubuntu, it doesn't show up. I'm running it with OpenJDK 8. I've already give it permission to run that file (from properties). Is there something else I need to do (add some code, manifest, or something else), to make it show up on Ubuntu? (I have Wine installed too). By show up, I mean of course the GUI I made. /Solution: I've uninstalled java completely and then installed and set it manually. Downloaded: Java SE Development Kit 8 / file: jdk-8u211-linux-x64.tar.gz
-
I have just tried running a jar file, made under Windows, on Ubuntu, and it works fine. Admittedly is does not use JavaFX or OpenJDK (whatever that is).
JavaFX part is actually what I need. If I'm running a simple jar (from console with java -jar Name.jar), it works fine, but the jar that has JavaFX doesn't work. If I simply try to run it directly with OpenJDK 8 Runtime, nothing shows up, but if I try to run the jar from console, I get the error "Error: Could not find or load main class package.Name", even tho it has the MANIFEST.MT generated in it by Eclipse with "Main-Class:", and the actual class too. Both projects exported the same way, both tested on Windows and working just fine, the only problem being that the one that is important (with JavaFX as GUI), doesn't work.
-
JavaFX part is actually what I need. If I'm running a simple jar (from console with java -jar Name.jar), it works fine, but the jar that has JavaFX doesn't work. If I simply try to run it directly with OpenJDK 8 Runtime, nothing shows up, but if I try to run the jar from console, I get the error "Error: Could not find or load main class package.Name", even tho it has the MANIFEST.MT generated in it by Eclipse with "Main-Class:", and the actual class too. Both projects exported the same way, both tested on Windows and working just fine, the only problem being that the one that is important (with JavaFX as GUI), doesn't work.
-
Sorry, but it's impossible to guess what is wrong. The error message suggest that your jar file is corrupt. You can unzip it with the jar -x command and check its contents.
The jar isn't corrupted, as I said on Windows it is working fine. From what I read, the problem is JavaFX, you need to do something else to be able to run a project with it on Ubuntu, but so far I haven't managed to make it work. /EDIT: I've added the project in Eclipse/Ubuntu, and it it working fine if I run it though Eclipse. Then I exported the project again as Runnable jar from Eclipse/Ubuntu and I have the same problem.
-
The jar isn't corrupted, as I said on Windows it is working fine. From what I read, the problem is JavaFX, you need to do something else to be able to run a project with it on Ubuntu, but so far I haven't managed to make it work. /EDIT: I've added the project in Eclipse/Ubuntu, and it it working fine if I run it though Eclipse. Then I exported the project again as Runnable jar from Eclipse/Ubuntu and I have the same problem.
-
That was the first thing I've done, but what all of those failed to mention, is that you need to install manually "Java SE Development Kit 8" in order to make JavaFX work.
-
That was the first thing I've done, but what all of those failed to mention, is that you need to install manually "Java SE Development Kit 8" in order to make JavaFX work.
-
The order depends on what server you are using, so your first might me on 3rd page for me for example.
-
The order depends on what server you are using, so your first might me on 3rd page for me for example.
-
This one (on Ask Ubuntu) java - JavaFX missing, Ubuntu 18.04 - Ask Ubuntu[^]
As I said, it didn't work using the command to get java, I had to manually take it from Oracle, and install it that way. And from Oracle, I didn't had to download openjfx separately (which still didn't worked that way), it came with jdk 8_211.