How to fix Java .jar files not opening with OpenJDK
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
How to fix Java .jar files not opening with OpenJDK
Sorry to dig up a nearly 3 year old thread, but I tried the fix and it isn't working for me. I'm running 18.3 Cinnamon with OpenJDK 8
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: How to fix Java .jar files not opening with OpenJDK
Awesome. Thanks for all the help guys.
Re: How to fix Java .jar files not opening with OpenJDK
Hi zac, and anyone else,
FYI: In addition to the great link from "xenopeek" on using java, there are some other things to consider.
Linux Mint can run most Java applications very well, but some Java applications will only run with Oracle's Java runtime and others will only run with OpenJDK Java (open source Java usually installed in Linux Mint) by just right clicking the "jar" file and selecting "open with" and pick which Java runtime to use (you might have to check for permission to run (execute) the jar file). I always install and make sure that both the OpenJDK Java 8 and Oracle's Java 8 runtimes are installed, just in case.
...
FYI: In addition to the great link from "xenopeek" on using java, there are some other things to consider.
Linux Mint can run most Java applications very well, but some Java applications will only run with Oracle's Java runtime and others will only run with OpenJDK Java (open source Java usually installed in Linux Mint) by just right clicking the "jar" file and selecting "open with" and pick which Java runtime to use (you might have to check for permission to run (execute) the jar file). I always install and make sure that both the OpenJDK Java 8 and Oracle's Java 8 runtimes are installed, just in case.
...
Phd21: Mint 20 Cinnamon & KDE Neon 64-bit Awesome OS's, Dell Inspiron I5 7000 (7573, quad core i5-8250U ) 2 in 1 touch screen
Re: How to fix Java .jar files not opening with OpenJDK
Hi, _zac.
As phd21 has already mentioned, it is imaginable that you try to run a .jar file which does not work under OpenJdk.
So the first thing which we need is the name of the .jar file which you try to run.
The next thing would be running the same command, which Nemo would run on right click, in the terminal and see what happens.
In case it works from the commandline, it should work through Nemo as well.
In case the commandline fails, it will not work when invoked by Nemo, either.
Regards,
Karl
Being sarcastic does not provide a more detailled explanation of what you did exactly and what exactly does not work.
As phd21 has already mentioned, it is imaginable that you try to run a .jar file which does not work under OpenJdk.
So the first thing which we need is the name of the .jar file which you try to run.
The next thing would be running the same command, which Nemo would run on right click, in the terminal and see what happens.
/usr/bin/java -jar /full/path/to/jarfile.jar
In case it works from the commandline, it should work through Nemo as well.
In case the commandline fails, it will not work when invoked by Nemo, either.
Regards,
Karl
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 771 days now.
Lifeline
Re: How to fix Java .jar files not opening with OpenJDK
Addendum:
It should even be a tiny little bit easier than explained by xenopeek. At least it was one my system here, where I had never bothered to instruct Nemo to open .jar files with a particular application.
Checked the corresponding commandline behind it. It read:
So, _zac, in case you should be monitoring this thread, it should work. In case it does not, please, verify every single of your steps. One will be incorrect.
In case you are no longer monitoring your thread, well, maybe it will help someone else.
It should even be a tiny little bit easier than explained by xenopeek. At least it was one my system here, where I had never bothered to instruct Nemo to open .jar files with a particular application.
Right clicked on a .jar file. Selected "Open With Other Application". The next box offerend me a list of available applications, one of which was labelled "OpenJDK Java 8 Runtime". Selected it. Confirmed. And surprise, the Java application came up.xenopeek wrote:Right-click a Java .jar file in your file manager and from the context menu select "Open With Other Application". In the input box at the bottom of the "Open With" dialog enter this command:
/usr/bin/java -jar
Click on the button "Set as default" and then on the button "OK" to close the dialog. Problem solved. When you now double-click Java .jar files in your file manager they will run as expected.
Checked the corresponding commandline behind it. It read:
/usr/bin/java -jar /opt/MSGViewer-1.9/MSGViewer.jar
So, _zac, in case you should be monitoring this thread, it should work. In case it does not, please, verify every single of your steps. One will be incorrect.
In case you are no longer monitoring your thread, well, maybe it will help someone else.
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 771 days now.
Lifeline