Problem Associating .jar Files to Run in JVM on Nautilus

If none of the more specific forums is the right place to ask

Problem Associating .jar Files to Run in JVM on Nautilus

Postby ReneAmat » 2012-02-21 22:23

Hey All,

I've been having trouble since I purged my sun-java packages due to that whole deal, and since then my .jar files haven't been properly associated in nautilus. It has the option to open them in the sun-jvm, since I re-installed the package following this problem, but it won't actually run them. Right clicking and changing it to use the custom command java -jar doesn't work, since I can't seem to add custom commands to the new nautilus in gnome-shell. I've tried reassociating the file with binfmts, and sent
Code: Select all
sudo update-binfmts --install JAR /usr/bin/jexec --extension jar
but to no avail. /usr/share/binfmts/jar reads:
Code: Select all
package openjdk-6
interpreter /usr/bin/jexec
magic PK\x03\x04


I've manually re-installed the open-jdk 6, and even re-installed sun-java, but my associations won't work. In case they are useful, update-alternatives --config java/java /c/ws read as:
Code: Select all
~/Downloads$ sudo update-alternatives --config java
There are 4 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                            Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java   1061      auto mode
  1            /opt/java/64/jre1.6.0_30/bin/java                1         manual mode
  2            /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java   1061      manual mode
* 3            /usr/lib/jvm/java-6-sun/jre/bin/java             63        manual mode
  4            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java   1051      manual mode

Press enter to keep the current choice[*], or type selection number:             
~/Downloads$ sudo update-alternatives --config javac
There are 2 choices for the alternative javac (providing /usr/bin/javac).

  Selection    Path                                         Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-7-openjdk-amd64/bin/javac   1051      auto mode
* 1            /usr/lib/jvm/java-6-sun/bin/javac             63        manual mode
  2            /usr/lib/jvm/java-7-openjdk-amd64/bin/javac   1051      manual mode

Press enter to keep the current choice[*], or type selection number:
~/Downloads$ sudo update-alternatives --config javaws
There are 2 choices for the alternative javaws (providing /usr/bin/javaws).

  Selection    Path                                              Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/javaws   1061      auto mode
  1            /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/javaws   1061      manual mode
* 2            /usr/lib/jvm/java-6-sun/jre/bin/javaws             63        manual mode

Press enter to keep the current choice[*], or type selection number:


Changing between the different installed versions has no effect.

It isn't a game-breaking deal, since I can still java -jar derp.jar in terminal, but it's somewhat annoying to do every time I need to run something in jvm. Any thoughts?
ReneAmat
 
Posts: 7
Joined: 2012-01-07 06:10

Re: Problem Associating .jar Files to Run in JVM on Nautilus

Postby conna » 2012-03-22 00:09

I've got exactly the same problem since a while and it's indeed kinda annoying to have a terminal running for every .jar.
conna
 
Posts: 12
Joined: 2012-01-22 15:38

Re: Problem Associating .jar Files to Run in JVM on Nautilus

Postby undernet » 2012-05-07 21:54

Bump, having exactly the same problem
undernet
 
Posts: 11
Joined: 2011-03-24 00:24

Re: Problem Associating .jar Files to Run in JVM on Nautilus

Postby kevmitch » 2012-05-08 05:38

Sounds like sun java may have left some mime crap around.
Debian Wiki on mime types
Arch wiki on same

Does running the following commands help?
Code: Select all
xdg-mime default openjdk-6-java.desktop application/x-jar
xdg-mime default openjdk-6-java.desktop application/java-archive
xdg-mime default openjdk-6-java.desktop application/x-java-archive
kevmitch
 
Posts: 498
Joined: 2008-01-29 20:43


Return to General Questions

Who is online

Users browsing this forum: No registered users and 11 guests

fashionable