LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 12-19-2012, 08:05 PM   #1
cpocanada
LQ Newbie
 
Registered: Dec 2012
Posts: 16

Rep: Reputation: Disabled
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)
Attached Thumbnails
Click image for larger version

Name:	RC-open-with.png
Views:	131
Size:	88.5 KB
ID:	11432   Click image for larger version

Name:	properties-OW.png
Views:	120
Size:	49.9 KB
ID:	11433  
 
Old 12-20-2012, 09:20 AM   #2
gacanepa
Member
 
Registered: May 2012
Location: San Luis, Argentina
Distribution: Debian
Posts: 205

Rep: Reputation: 27
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>.
 
1 members found this post helpful.
Old 12-20-2012, 12:10 PM   #3
cpocanada
LQ Newbie
 
Registered: Dec 2012
Posts: 16

Original Poster
Rep: Reputation: Disabled
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/
 
Old 12-20-2012, 01:54 PM   #4
gacanepa
Member
 
Registered: May 2012
Location: San Luis, Argentina
Distribution: Debian
Posts: 205

Rep: Reputation: 27
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.
 
2 members found this post helpful.
Old 01-19-2013, 10:01 PM   #5
cpocanada
LQ Newbie
 
Registered: Dec 2012
Posts: 16

Original Poster
Rep: Reputation: Disabled
Thanks, that worked.
 
Old 01-20-2013, 05:45 PM   #6
gacanepa
Member
 
Registered: May 2012
Location: San Luis, Argentina
Distribution: Debian
Posts: 205

Rep: Reputation: 27
Quote:
Originally Posted by cpocanada View Post
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.
 
Old 02-11-2013, 02:17 PM   #7
cpocanada
LQ Newbie
 
Registered: Dec 2012
Posts: 16

Original Poster
Rep: Reputation: Disabled
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Making Java A Default Application To Run .Jar's (Ubuntu 12.04) 0wn3r Linux - Newbie 23 02-03-2013 04:23 PM
LXer: How to run Linux Mint Debian Cinnamon in VirtualBox LXer Syndicated Linux News 1 04-26-2012 07:17 PM
How to write a daemon Linux service to a Java application which execute a .jar haseit Linux - Newbie 2 10-14-2011 03:10 AM
KDE jar MIME is application/zip and not application/java-archive in Ubuntu Intrepid? arobinson74 Linux - Software 2 09-18-2009 11:40 AM
how do i execute a jar (java application) in linux amolgupta Linux - Software 2 07-20-2006 05:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration