java alternatives missing after upgrade to precise

Bug #905808 reported by Martin Pool
28
This bug affects 6 people
Affects Status Importance Assigned to Milestone
openjdk-6 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

after upgrading to precise, the java alternatives symlinks seem to be broken, and not fixed by update-java-alternatives, which complains:

mbp@joy% sudo update-java-alternatives -v -s java-1.6.0-openjdk-amd64
resetting java alternatives
update-alternatives: error: no alternatives for appletviewer.
update-alternatives: error: no alternatives for apt.
update-alternatives: error: no alternatives for extcheck.
update-alternatives: error: no alternatives for idlj.
update-alternatives: error: no alternatives for jarsigner.
update-alternatives: error: no alternatives for java.
update-alternatives: error: no alternatives for javac.
....

(or similarly with --auto)

the binary files do exist and the .jinfo file seems valid. It is true there is no java alternative in /etc/alternatives.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: openjdk-6-jdk 6b24~pre2-0ubuntu2
ProcVersionSignature: Ubuntu 3.2.0-4.10-generic 3.2.0-rc5
Uname: Linux 3.2.0-4-generic x86_64
ApportVersion: 1.90-0ubuntu1
Architecture: amd64
Date: Sun Dec 18 08:27:26 2011
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101007)
SourcePackage: openjdk-6
UpgradeStatus: Upgraded to precise on 2011-12-15 (2 days ago)

Revision history for this message
Martin Pool (mbp) wrote :
Revision history for this message
Martin Pool (mbp) wrote :

running the postinst configure script for the jdk packages seems to have reestablished the alternatives. I'm not sure how it got this way.

Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in openjdk-6 (Ubuntu):
status: New → Confirmed
Revision history for this message
Dan Kegel (dank) wrote :

I think I just ran into this on a freshly installed and updated 12.04 alpha 1 system. I did
  apt-get install openjdk-7-jdk
and java alternatives were ok, but after
  aptitude remove java-common icedtea-7-jre-jamvm openjdk-7-jdk openjdk-7-jre openjdk-7-jre-headless openjdk-7-jre-lib
  apt-get install openjdk-7-jdk
there were no java alternatives. Same thing with openjdk-6; they're ok on first install, but not on reinstall.

The workaround, as Martin noted, is to run
       sudo /usr/share/debconf/frontend /var/lib/dpkg/info/openjdk-7-jre-headless:amd64.postinst configure
       sudo /usr/share/debconf/frontend /var/lib/dpkg/info/openjdk-7-jdk:amd64.postinst configure

Revision history for this message
Dan Kegel (dank) wrote :

This bug seems to also affect ubuntu 11.10 amd64.
I ran into it with the script
  http://code.google.com/p/winezeug/source/browse/trunk/cmake_examples/ex11/test.sh
which does a 'hello, jni' test with a bunch of different jdks.

The workaround there is slightly different because 11.10 isn't multiarch:
sudo /usr/share/debconf/frontend /var/lib/dpkg/info/openjdk-6-jre-headless.postinst configure
etc.

Revision history for this message
Philip Muškovac (yofel) wrote :

dup of bug 887077?

Revision history for this message
Jonas Eschenburg (indyjo) wrote :

I stumbled upon this problem when I tried to prepare a backport of OpenJDK 6 and 7 to Debian squeeze. The problem appears to be caused by the file debian/JB-jre.postinst.

It tries to avoid installing its alternatives in case of an upgrade, assuming that those alternatives must have already been installed by the previous version. IMHO this is an illegal assumption, as the previous version could have been deconfigured or broken somehow.

So the fix I propose is to set "update_alternatives" to "y" and not try to be clever about it.

The other debian/JB-*.postinst files seem to have the same problem.

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.