Mixed Java command versions after installing openjdk-7-jdk

Bug #901758 reported by Louis Zuckerman on 2011-12-08
This bug affects 2 people
Affects Status Importance Assigned to Milestone
openjdk-7 (Ubuntu)

Bug Description

On a new Oneiric i386 machine I ran 'apt-get install openjdk-7-jdk'. This machine had no Java installed previously. Installing this package required installing openjdk-6-jdk, as well as the -jre for both versions 6 & 7. After the install was complete I was left with this awful result...

# java -version
java version "1.6.0_23"
OpenJDK Runtime Environment (IcedTea6 1.11pre) (6b23~pre11-0ubuntu1.11.10)
OpenJDK Client VM (build 20.0-b11, mixed mode, sharing)

# javac -version
javac 1.7.0_147

Thats right, my javac command uses JDK7 but my java command uses JRE6.

Looking in /etc/alternatives for symlinks to Java-related executables, i see 13 links to Java6 programs, and 28 links to Java7 programs.

Here is the alternatives information for 'java' command

# update-alternatives --display java
java - auto mode
  link currently points to /usr/lib/jvm/java-6-openjdk/jre/bin/java
/usr/lib/jvm/java-6-openjdk/jre/bin/java - priority 1061
  slave java.1.gz: /usr/lib/jvm/java-6-openjdk/jre/man/man1/java.1.gz
/usr/lib/jvm/java-7-openjdk-i386/jre/bin/java - priority 1051
  slave java.1.gz: /usr/lib/jvm/java-7-openjdk-i386/jre/man/man1/java.1.gz
Current 'best' version is '/usr/lib/jvm/java-6-openjdk/jre/bin/java'.

And the same for the 'javac' command

# update-alternatives --display javac
javac - auto mode
  link currently points to /usr/lib/jvm/java-7-openjdk-i386/bin/javac
/usr/lib/jvm/java-7-openjdk-i386/bin/javac - priority 1051
  slave javac.1.gz: /usr/lib/jvm/java-7-openjdk-i386/man/man1/javac.1.gz
Current 'best' version is '/usr/lib/jvm/java-7-openjdk-i386/bin/javac'.

Launchpad Janitor (janitor) wrote :

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

Changed in openjdk-7 (Ubuntu):
status: New → Confirmed

openjdk-7-jdk has a dependency on openjdk-6-jre that it shouldn't. This results in openjdk-6-jre being installed with all of the "jre" alternatives set to openjdk-6-jre instead of openjdk-7-jdk like you'd expect from an installation of openjdk-7-jdk on a fresh Ubuntu 11.10 system.

If you run the following, you can see that both versions of openjdk are listed as java alternatives:
# update-java-alternatives --list
java-1.6.0-openjdk 1061 /usr/lib/jvm/java-1.6.0-openjdk
java-1.7.0-openjdk-amd64 1051 /usr/lib/jvm/java-1.7.0-openjdk-amd64

If you run the following, it will update all of your alternatives to use java-7-openjdk:
sudo update-java-alternatives --set java-1.7.0-openjdk-amd64

But you will now see two other bugs:
1) There is no icedtea7-plugin in 11.10. openjdk-7-jdk installs icedtea-plugin, but this is the openjdk6 version. https://bugs.launchpad.net/ubuntu/+source/icedtea-web/+bug/905714
2) The .jinfo file incorrectly has -javaplugin.so instead of mozilla-javaplugin.so https://bugs.launchpad.net/ubuntu/+source/openjdk-7/+bug/966212

Matthias Klose (doko) wrote :

the dependencies are fixed in precise and quantal

Changed in openjdk-7 (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers