LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Making Java Runtime Default Application To Run .Jar's (Linux Mint 14 Cinnamon) (https://www.linuxquestions.org/questions/linux-newbie-8/making-java-runtime-default-application-to-run-jars-linux-mint-14-cinnamon-4175442239/)

cpocanada 12-19-2012 08:05 PM

Making Java Runtime Default Application To Run .Jar's (Linux Mint 14 Cinnamon)
 
2 Attachment(s)
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)

gacanepa 12-20-2012 09:20 AM

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>.

cpocanada 12-20-2012 12:10 PM

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/

gacanepa 12-20-2012 01:54 PM

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.

cpocanada 01-19-2013 10:01 PM

Thanks, that worked.

gacanepa 01-20-2013 05:45 PM

Quote:

Originally Posted by cpocanada (Post 4873850)
Thanks, that worked.

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.

cpocanada 02-11-2013 02:17 PM

solved by Snark1994
 
This will do it. Thanks Snark1994!


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:

application/x-java-archive=openjdk-7-java.desktop


from:
http://www.linuxquestions.org/questi...ml#post4883785


All times are GMT -5. The time now is 06:33 AM.