0

hi , I used to right click on a .jar file and select " open with openjdk " from the option menu , last night my computer was updated ,openjdk version 7 is installed but that option is no longer there when I right click on the .jar file , it is not even listed in the " open with " menu but when I type java -jar file.jar in the terminal it works . how can I get back that option in the menu

3
Contributors
4
Replies
15
Views
2 Years
Discussion Span
Last Post by fonzali
0

Two possible ways of doing this:

  1. edit your menu settings from within your DM settings menu, or
  2. within IcedTea control panel, check appriopriate box that triggers showing "Open with JDK" in context menus. In KDE it looks moreless like this:
    snapshot1.png

HTH

Edited by dtpp

0

Hi! If using Ubuntu then open the terminal and type:

locate java.desktop

It should find few entries under /usr/share/app-install/desktop/, these are the files used to generate the desktop entries. If you don't get results try to update the mlocate database through the command updatedb. If you get some results the one you need is:

openjdk-7-jre\:openjdk-7-java.desktop

So open the mimeapps.list file in your profile:

leafpad ~/.local/share/applications/mimeapps.list

And add this line:

application/jar=openjdk-7-jre\:openjdk-7-java.desktop;

The format is simple: mime-type = app.desktop. Then if the option does not appear, create a shortcut in ~/.local/share/applications/:

ln -s /usr/share/app-install/desktop/openjdk-7-jre\:openjdk-7-java.desktop ~/.local/share/applications/.

And then it should work. If this does not help then you have to manually create a .desktop file, these are the contents of mine:

[Desktop Entry]
X-AppInstall-Package=openjdk-7-jre
X-AppInstall-Popcon=7303
X-AppInstall-Section=main

Name=OpenJDK Java 7 Runtime
Comment=OpenJDK Java 7 Runtime
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

X-Ubuntu-Gettext-Domain=app-install-data

Hope it helps, bye!

0

thank you , it worked after creating the shortcut in ~/.local/share/applications/

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.