[SOLVED] Making Java Runtime Default Application To Run .Jar's (Linux Mint 14 Cinnamon)
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.
Making Java Runtime Default Application To Run .Jar's (Linux Mint 14 Cinnamon)
I can execute a .jar file but I have to select "Java Runtime Enviroment" every time. I want to execute this file with Java Runtime by default. I have Linux Mint 14 64 bit, Cinnamon. When I right-click on the file and go to open with, from the drop down, I have in the list: Java Runtime, Java Web Start, and OpenJDK Java 7 Runtime. The ones that will run it are: Java Runtime and OpenJDK Java 7 Runtime. However, when I go to the .jar file, properties > open with > show other applications, neither of these are listed. How can I change this? How can I add Java Runtime to this list? Note that I installed Java from the instructions on this page [w**.duinsoft.nl/packages.php?t=en] (under repository) and java works great.
output of java -version:
java version "1.7.0_10"
Java(TM) SE Runtime Environment (build 1.7.0_10-b18)
Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)
First off, not all jar files are executable, so getting a sneak peak of the permissions tab of the file that you're trying to open would be very helpful .
If it's indeed a executable file, and you have permission to execute it, you should be able to open it either by double-clicking on it or by typing on the terminal java -jar <myjarfile.jar>.
Thanks gacanepa, but that is not my question. It is executable, and I can execute it. My question is how can I run it with Java Runtime by default. The file is fast image resizer for java, you can download it yourself and see that it is executable h**p://sourceforge.net/projects/fir4j/files/
I downloaded the file, extracted it and placed its contents inside a folder named fir4j on my desktop.
Then created a launcher by right clicking on the desktop and used the following command inside a desktop launcher:
Code:
java -jar /home/gacanepa/Desktop/fir4j/fir4j.jar
Then saved it, doubled clicked on it and voila, it worked like a charm.
Let me know if you need additional help or detailed step-by-step instructions - I'll be more than glad to help.
If you found the solution to your original question, mark this thread as SOLVED, and consider adding to my reputation (click on the scales next to the penguin) .
I'm glad to have been of help.
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:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.