Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Problem Associating .jar Files to Run in JVM on Nautilus

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
ReneAmat
Posts: 7
Joined: 2012-01-07 06:10

Problem Associating .jar Files to Run in JVM on Nautilus

#1 Post by ReneAmat »

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?

conna
Posts: 21
Joined: 2012-01-22 15:38

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

#2 Post by conna »

I've got exactly the same problem since a while and it's indeed kinda annoying to have a terminal running for every .jar.

undernet
Posts: 11
Joined: 2011-03-24 00:24

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

#3 Post by undernet »

Bump, having exactly the same problem

kevmitch
Posts: 498
Joined: 2008-01-29 20:43

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

#4 Post by kevmitch »

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

Post Reply