Making Java A Default Application To Run .Jar's (Ubuntu 12.04)
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
After putting the following into terminal,
xdg-mime default .local/share/applications/update-sun-jre-java.desktop application/java-archive
Nothing has changed.
But that's okay, it's not a big deal, if I don't find a way to change the default to open with Java Runtime, no problem.
When I double-click the file or use xdg-open file-in-question.jar or right-click > open with java web start: java 7 in some form starts up and then reports "Unable to launch application". However when I right click on the .jar file, click open with > java runtime, then in opens fine.
I don't want to mark it as solved, because my original question isn't solved. Is it important to close this thread? I thought that since I have a common distro and that my questions could help others, I would ask for help. Thanks again for your patience!
I don't want to mark it as solved, because my original question isn't solved. Is it important to close this thread? I thought that since I have a common distro and that my questions could help others, I would ask for help. Thanks again for your patience!
Actually, you can't mark it as SOLVED because it's not your thread. But never mind, hopefully if we find a solution, then it will benefit the OP too.
When you go Properties > Open With... is there an option to "Browse for more" or "Browse for executable" or something similar? It may only appear when you click on "Show Other Applications". If so, then just find java and select it. If not, then could we maybe have a screenshot? I feel there must be a way of doing what you want to do...
There is an option "show other applications" but can't browse, it only gives a list of more programs, and Java Runtime isn't on the list. Java WebStart will not open the .jar file and reports "Unable to launch application". Whereas [right-click on file > open with Java Runtime] runs .jar file perfectly.
Hm... And that "Add" button is greyed out no matter where/what you click? Perhaps we need to find someone who actually runs Mint, or maybe I can boot it in a VM...
Okay, we got the problem sorted at least in cpocanada's case: the problem was that the correct mimetype is "application/x-java-archive" (I mistakenly said "application/java-archive"). So the fix was to use the following line in .local/share/applications/mimeapps.list:
Quote:
application/x-java-archive=openjdk-7-java.desktop
@0wn3r: If this also fixes your problem, then please mark this thread as SOLVED using the link at the top of the page.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.