Author Topic: associate .jar files to java runtime?  (Read 2220 times)

Offline yeshe

  • Sr. Member
  • ****
  • Posts: 274
  • Forest sangha
associate .jar files to java runtime?
« on: February 02, 2011, 08:04:17 AM »
I want to run .jar files as java-programs by just click on the icon. It is now associated as a Ark-file. When I try to associate it to java (I go to "configure your desktop" > file-associations > Applications > X-java archive and there I find the .jar associations. When I try to add java runtime I cannot find it among the programs suggested.

I have "sun java 6u23 runtime" and that one is the default in Firefox for opening .jar files. How can I add sun java runtime to the list of programs?

EDIT. under "sun java 6u23" in the list I have three choises: Plugin Control Panel, Policy Tool and Web start - non of them are the java runtime.

Actually, this question is a general question how to associate files to programs that are not in the start menu.
« Last Edit: February 02, 2011, 09:14:14 AM by yeshe »

Offline CaptainSarcastic

  • Sr. Member
  • ****
  • Posts: 328
Re: associate .jar files to java runtime?
« Reply #1 on: April 26, 2011, 11:10:37 PM »
I don't see a reply to this, but found it because I was searching on a similar issue.  I have two machines, one running PCLOS Gnome and this new one running KDE.  Both up-to-date, both running PAE kernels.  On the Gnome machine I can double-click the .jar (RemoteDroidServer.jar, for what it'sworth) and it opens right up.  Here on KDE it is opening in Ark, and I don't see a method of having it launch.

Offline OldGuy

  • Hero Member
  • *****
  • Posts: 661
  • "All that is not given, is lost." Hasari Pal
Re: associate .jar files to java runtime?
« Reply #2 on: April 26, 2011, 11:23:07 PM »
Using Gnome, I use a right-click to "create a launcher" you have to fill in the details, like what you want to call the button (Name), and the Command (java -jar sampleprogram.jar).  It's pretty easy, just have to make sure you are pathed right for the command like java -jar "/home/rose/Travel/Mike Spot/Dragon/passworddragon.jar"
will run my password program.

Hope this helps..

Offline rich2005

  • Sr. Member
  • ****
  • Posts: 257
Re: associate .jar files to java runtime?
« Reply #3 on: April 27, 2011, 07:10:22 AM »
using pclos2010kde

Using dolphin go to where your jar files are stored, (could be desktop, but you are better off with them elsewhere and a link to the desktop.)

Richt click on a jar file and select 'Open With'
Top of the dialog enter java -jar
bottom of the dialog tick the 'remember' box
ok to close out

Should now associate with a desktop icon.  Seems to survive a reboot which is more than I can say about other distros.

a couple of screen shots here
http://i.imgur.com/PVuoy.jpg


Offline CaptainSarcastic

  • Sr. Member
  • ****
  • Posts: 328
Re: associate .jar files to java runtime?
« Reply #4 on: April 27, 2011, 09:27:36 PM »
Thank you, Rich - that seemed to do the trick.  I can now use my phone as a remote control on this computer, too.

Offline yeshe

  • Sr. Member
  • ****
  • Posts: 274
  • Forest sangha
Re: associate .jar files to java runtime?
« Reply #5 on: April 28, 2011, 04:39:47 AM »
Thank you.  :)

I also checked the box "open in terminal" in case some java-programs may have some output there.

Offline agmg

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1916
  • Certified Windows Hater
Re: associate .jar files to java runtime?
« Reply #6 on: March 18, 2012, 03:17:42 AM »
using pclos2010kde

Using dolphin go to where your jar files are stored, (could be desktop, but you are better off with them elsewhere and a link to the desktop.)

Richt click on a jar file and select 'Open With'
Top of the dialog enter java -jar
bottom of the dialog tick the 'remember' box
ok to close out

Should now associate with a desktop icon.  Seems to survive a reboot which is more than I can say about other distros.

a couple of screen shots here
http://i.imgur.com/PVuoy.jpg




Sorry for digging up this old topic, but thought it would be better not to start a new one for this issue...

I tried to associate .jar files with java using the method described above but this also affects .zip files... When I double-click a .zip file, the system tries to open it with java. This doesn't happen with .rar files as they open normally. Is there another way to do this?
For the whole world, you are someone.
For someone, you are the whole world.

Offline rich2005

  • Sr. Member
  • ****
  • Posts: 257
Re: associate .jar files to java runtime?
« Reply #7 on: March 18, 2012, 06:43:56 AM »
AFAIK it is a trade-off, you have to decide what you prefer to open with a left mouse click in Dolphin.

Go into configure my desktop, then file associations.  Look at the zip entry. If java is above Ark move it down and ok it.

A zip file should now open with Ark, but for a java app you will need to right-click and choose java.

some screenshots http://i.imgur.com/BSKRm.jpg

maybe someone has better info on these file associations.

Offline agmg

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1916
  • Certified Windows Hater
Re: associate .jar files to java runtime?
« Reply #8 on: March 18, 2012, 07:10:26 AM »
Thanks for your quick reply! :)
For the whole world, you are someone.
For someone, you are the whole world.