Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have recently upgraded to 12.04 and I am using GNOME classic.

I want to run a .jar file by simply double clicking it. How would I go about doing this? I have OpenJDK 6 installed.

share|improve this question
up vote 1 down vote accepted

Here is a desktop file I wrote. Stick it in a file named Java.desktop under ~/.local/share/applications:

[Desktop Entry]
Encoding=UTF-8
Name=Java (Jar)
Exec=java -jar %u
Type=Application
Terminal=true
MimeType=application/x-java-archive

If the folder does not exist then you can create it as follows:

mkdir -p ~/.local/share/applications
share|improve this answer
    
I don't have that directory. – Harris6310 Apr 8 '12 at 18:47
    
Then create it. – Relish Apr 8 '12 at 18:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.