I have a few .Jar applications that I wanted to be able to execute as a regular application from within Gnome 3 but everytime I double clicked them it wanted to open File Roller Gnome's archave manager.
I did not want to open a terminal everytime I wanted to execute a .Jar file just to type java -jar {filename} so i did a little research and made it work with the double click and now I want to make sure everyone else knows how to do it.
First I edited /usr/share/applications/defaults.list
Output from Diff of /usr/share/applications/defaults.list
diff defaults.list /home/viroscope/Original\ Files/defaults.listWhat this means is I changed gnome-file-roller.desktop to the at the time nonexistant file java.desktop
235c235
< application/x-java-archive=java.desktop;
---
> application/x-java-archive=gnome-file-roller.desktop;
Second I edited /usr/share/applications/mimeinfo.cache
Output From Diff of /usr/share/applications/mimeinfo.cache
diff mimeinfo.cache /home/viroscope/Original\ Files/mimeinfo.cacheHere this means I changed gnome-file-roller.desktop to again the non-existant file java.desktop
70c70
< application/x-java-archive=java.desktop;
---
> application/x-java-archive=gnome-file-roller.desktop;
Lastly I created the java.Desktop file in /usr/share/applications and it's contents are:
[Desktop Entry]
Name=Movie Player
Comment=Execute Java .jar Files From File Manager
Icon=
Exec=java -jar %f
Terminal=false
MimeType=application/x-java-archive
Type=Application
Categories=Application;
Then all you do is log out and back into gnome and the .jar files run on double click.

No comments:
Post a Comment