Categories
HowTo Posts Ubuntu

HowTo: Run .jar files in Ubuntu

To run a JAR file from the command line in ubuntu using the following command:

java -jar filename.jar

Otherwise it is also possible to enable double clicking to run jar files too by the following simple steps:

  1. Find the .jar file in the File Browser (a.k.a Nautilus)
  2. Right click the .jar file > Properties
  3. Click on the “Open With” tab along the top
  4. Change the bullet to be Sun Java 6 Runtime
  5. Click Close and you’re done.

Now you should be able to just double click the file and it will run just like most other files!

13 replies on “HowTo: Run .jar files in Ubuntu”

hahaha! yes, yes they are :) oh wait this post is fully empty :/ should sort that out

I do not have a radio button for java 6, but I have installed sun java. How do I get the radio button, or what is the command for a custom command (I know where it’s installed to, but I don’t know what file I need to use)?

Simple and to the point talk.
But my friend you are missing that beside all this one shall have to select the checkbox for ‘Allow executing file as program’ on the ‘Permissions’ tab. Only then a ‘.jar’ file will run by double clicking on it, otherwise it will open in Archive Manager for content browsing.
This is my personal experience on linuxmint 10 Julia!!

So simple and so easy, but it still took me upwards of 40 minutes to find your post. Thank you! I will share this with others who want to know by directing them here.

Hi I am getting error message:

The file ‘/home/bravo/NetBeansProjects/Test/dist/Test.jar’ is not marked as executable. If this was downloaded or copied from an untrusted source, it may be dangerous to run. For more details, read about the executable bit.

Please helpt !!!

Reply to bravo’s:
Hi I am getting error message:

The file ‘/home/bravo/NetBeansProjects/Test/dist/Test.jar’ is not marked as executable. If this was downloaded or copied from an untrusted source, it may be dangerous to run. For more details, read about the executable bit.

Please helpt !!!
Right click .jar file, click permissions, and make sure “allow running as executable” is selected

[…] you can't "convert" it, you'd need to write a deb package from scratch for it, but as it's just one measly file, why bother?? if it's just for YOU then you'll be making an obscene amount of work for just about zero benefit, and seeing as the net result of "installing" it would merely be to put in in a given location, just do it manually. You'll have made your lot no easier whatsoever. I presume that this is more useful… http://alexsleat.co.uk/2010/06/07/ho…les-in-ubuntu/ […]

Leave a Reply

Your email address will not be published. Required fields are marked *