Is the mechanism the browser uses to execute a jar file different from the way it is done in a terminal?
Yes it is different.
[1] THe easiest way is to Right Click any *.jar file > Open with other application > Use a custom command > And in the dialog box enter:
- Code: Select all
java -jar
From then on a double click should run it.
[2] You could do this system wide if you want although if you are the only user the method above should do it:
- Code: Select all
gksu pluma /usr/share/applications/openjdk-7-java.desktop
This is what you should see:
[Desktop Entry]
Name=OpenJDK Java 7 Runtime
Name[fi]=OpenJDK Java 7 - ajonaikainen ympäristö
Comment=OpenJDK Java 7 Runtime
Comment[fi]=OpenJDK Java 7 - ajonaikainen ympäristö
Exec=cautious-launcher %f /usr/bin/java -jar
Terminal=false
Type=Application
Icon=openjdk-7
MimeType=application/x-java-archive;application/java-archive;application/x-jar;
NoDisplay=true
It's "cautious-launcher %f" that's messing you up so just remove it so that the whole file looks like this:
[Desktop Entry]
Name=OpenJDK Java 7 Runtime
Name[fi]=OpenJDK Java 7 - ajonaikainen ympäristö
Comment=OpenJDK Java 7 Runtime
Comment[fi]=OpenJDK Java 7 - ajonaikainen ympäristö
Exec=/usr/bin/java -jar
Terminal=false
Type=Application
Icon=openjdk-7
MimeType=application/x-java-archive;application/java-archive;application/x-jar;
NoDisplay=true
A jar file in and of itself is not an executable entitiy so it really doesn't need to be made executable. "cautious-launcher" is something Ubuntu added - mostly just because they can.