Openjdk 7 and 8 don't automatically open jar files

Bug #1474379 reported by PEIGNOT Kévin
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
One Hundred Papercuts
Confirmed
High
Unassigned
desktop-file-utils (Ubuntu)
Confirmed
High
Unassigned
openjdk-6 (Ubuntu)
Confirmed
High
Unassigned
openjdk-7 (Ubuntu)
Confirmed
High
Unassigned
openjdk-8 (Ubuntu)
Confirmed
High
Unassigned

Bug Description

Hi

I made a fresh install today and discovered a bug with java. If you have a .jar file (like josm or sweethome3d) and try to open it from nautilus it doesn't works : It opens file-roller and you can't choose anything else.

I had openjdk 8 installed, but with a right click to "Open With", It wasn't proposed.
I installed openjdk 7, same problem.
I installed openjdk 6 : It worked : Openjdk 6 was proposed.

I discovered (thanks to http://askubuntu.com/questions/183086/java-not-recognized-as-default-application) that Openjdk 7 and 8 dont create .desktop files in /usr/share/applications, as Openjdk 6 do (openjdk-6-java.desktop). Here is a part of the result of 'ls /usr/share/applications' command :

[...]
onboard-settings.desktop
openjdk-6-java.desktop
openjdk-6-policytool.desktop
openjdk-7-policytool.desktop
openjdk-8-policytool.desktop
orca.desktop
[...]

I created openjdk-7-java.desktop and openjdk-8-java.desktop and openjdk-default-java.desktop files with openjdk-6-java.desktop as a model (and keeping openjdk 6 icon as 8 doesn't propose any), and used the following command to exec (just to know exactly What I did) :
- /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java -jar
- /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java -jar
- /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -jar
- /usr/bin/java -jar

By default, openjdk 6 uses /usr/bin/java -jar. That meens that the Openjdk 6 launcher doesn't launch version 6 but the default version from update-alternatives. If you don't have version 6 installed, by default you can't launch .jar files.

ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: desktop-file-utils 0.22-1ubuntu3
ProcVersionSignature: Ubuntu 3.19.0-22.22-generic 3.19.8-ckt1
Uname: Linux 3.19.0-22-generic x86_64
ApportVersion: 2.17.2-0ubuntu1.1
Architecture: amd64
CurrentDesktop: Unity
Date: Tue Jul 14 15:14:14 2015
InstallationDate: Installed on 2015-07-14 (0 days ago)
InstallationMedia: Ubuntu 15.04 "Vivid Vervet" - Release amd64 (20150422)
ProcEnviron:
 LANGUAGE=fr_FR
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=fr_FR.UTF-8
 SHELL=/bin/bash
SourcePackage: desktop-file-utils
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
PEIGNOT Kévin (kpeignot) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in desktop-file-utils (Ubuntu):
status: New → Confirmed
Changed in openjdk-6 (Ubuntu):
status: New → Confirmed
Changed in openjdk-7 (Ubuntu):
status: New → Confirmed
Changed in openjdk-8 (Ubuntu):
status: New → Confirmed
Changed in desktop-file-utils (Ubuntu):
importance: Undecided → High
Changed in openjdk-6 (Ubuntu):
importance: Undecided → High
Changed in openjdk-7 (Ubuntu):
importance: Undecided → High
Changed in openjdk-8 (Ubuntu):
importance: Undecided → High
Changed in hundredpapercuts:
status: New → Confirmed
importance: Undecided → High
tags: added: rls-w-incoming
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.