[feisty] update-alternatives doesn't notice java6

Bug #84790 reported by Nicolò Chieffo
36
Affects Status Importance Assigned to Milestone
sun-java6 (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

update-alternatives doesn't seem to detect files in sun-java6 packages. (-bin and -jre installed) so no /usr/bin/java

Revision history for this message
Áron Sisak (asisak) wrote :

What is the version of Ubuntu are you running? Do you use Feisty or Edgy backports? Please provide an "update-alternatives --list java" output.

For me it works fine, Feisty, x86:

There are 4 alternatives which provide `java'.

  Selection Alternative
-----------------------------------------------
* 1 /usr/lib/jvm/java-1.5.0-sun/jre/bin/java
+ 2 /usr/lib/jvm/java-gcj/jre/bin/java
          3 /usr/bin/gij-wrapper-4.1
          4 /usr/lib/jvm/java-6-sun/jre/bin/java

Changed in sun-java6:
assignee: nobody → asisak
importance: Undecided → Medium
status: Unconfirmed → Needs Info
Revision history for this message
Nicolò Chieffo (yelo3) wrote : Re: [Bug 84790] Re: [feisty] update-alternatives doesn't notice java6

I said it worked after a reboot! sorry!

Revision history for this message
Áron Sisak (asisak) wrote :

It should work without a reboot, however, it might have been fixed since.
Do you use Edgy or Feisty?

Revision history for this message
Nicolò Chieffo (yelo3) wrote :

feisty! mybe a logout could be enough to update some variables...

Revision history for this message
Nicolò Chieffo (yelo3) wrote :

Yes a logout was enough. I will reject the bug. Sorry for opening it!

Changed in sun-java6:
status: Needs Info → Rejected
Revision history for this message
Áron Sisak (asisak) wrote :

Thanks for reporting it!

Revision history for this message
Áron Sisak (asisak) wrote :

Please provide more information if this issue is still present and if a re-login really solves it.

Changed in sun-java6:
importance: Medium → Low
status: Rejected → Needs Info
Revision history for this message
Nikolaus Rath (nikratio) wrote :

Hello,

This issue is still present. I don't know whether a relogin fixed it, but yesterday I had exactly the same problem (update-alternatives --list did not list java6) and today it worked. I have not done anything requiring superuser rights in the meantime.

What information do you need?

Revision history for this message
Pascal De Vuyst (pascal-devuyst) wrote :

Same problem with java6 from Edgy updates.

$ /usr/bin/java
bash: /usr/bin/java: No such file or directory

$ dpkg -l sun-java* | grep ii
ii sun-java6-bin 6-00-0ubuntu1~edgy1 Sun Java(TM) Runtime Environment (JRE) 6
ii sun-java6-jre 6-00-0ubuntu1~edgy1 Sun Java(TM) Runtime Environment (JRE) 6
ii sun-java6-plugin 6-00-0ubuntu1~edgy1 The Java(TM) Plug-in, Java SE 6

$ update-alternatives --list java
/usr/lib/jvm/java-gcj/jre/bin/java
/usr/bin/gij-wrapper-4.1
/usr/lib/jvm/java-6-sun/jre/bin/java

Revision history for this message
Pascal De Vuyst (pascal-devuyst) wrote :

I meant Edgy backports instead of updates.

Revision history for this message
Bryan Quigley (bryanquigley) wrote :

I have the same problem, and I have logged in rebooted logged out many times.

update-alternatives --list java
/usr/lib/jvm/java-6-sun/jre/bin/java
/usr/bin/gij-wrapper-4.1
bryan@bryan-lin:~$ java
The program 'java' can be found in the following packages:
 * j2re1.4
 * gij-4.1
 * jamvm
 * cacao
 * sablevm
Try: sudo apt-get install <selected package>
Make sure you have the 'universe' component enabled
bash: java: command not found
bryan@bryan-lin:~$

I have: sun-java6-bin sun-java6-fonts sun-java6-jre sun-java6-plugin
installed.

What more information can I provide to help this get fixed? / or is there some magical work around?

Revision history for this message
Matthias Klose (doko) wrote :

sudo update-java-alternative --list
sudo update-java-alternative --auto

sudo update-java-alternative --set java-6-sun

Revision history for this message
Bryan Quigley (bryanquigley) wrote :

thank you! Got it working by doing the above, btw, it is update-java-alternatives
so...

sudo update-java-alternatives --list
sudo update-java-alternatives --auto

sudo update-java-alternatives --set java-6-sun

I have not been able to reproduce this bug.

Revision history for this message
James Cole (intangi) wrote :

What seems to happen is that update-alternatives correctly sets java6 as the default, however the symlink of /usr/bin/java is linked to /etc/alternatives/java which is only handled by update-java-alternatives not the usual update-alternatives.

Is there anyway to make that a bit less confusing or has update-java-alternatives always been the proper way to handle the symlinks for java in /etc/alternatives?

Revision history for this message
James Shaw (hertzsprung) wrote :

I've experienced this problem today in dapper. I chose to remove sun-java5-* and install sun-java6-*, and this appeared to complete successfully. However, there is no longer any symlink in /etc/alternatives and so "java" is no longer on the path.

"sudo update-java-alternatives --list" does show java-6-sun 63 /usr/lib/jvm/java-6-sun. A reboot does not fix this problem.

Revision history for this message
Áron Sisak (asisak) wrote :

This issue seems to be fixed in Feisty and Gutsy. I am not sure what to do in Dapper.

Changed in sun-java6:
assignee: asisak → nobody
Revision history for this message
Nicolò Chieffo (yelo3) wrote :

works well now

Changed in sun-java6:
status: Incomplete → Fix Released
Revision history for this message
laga (laga) wrote :

This problem still exists in Gutsy amd64 for me.

I had a lot of different java "flavours" installed (all using packages) and decided to remove them when I was triaging an unrelated bug.

After removing the icedtea-java7* packages and installing the sun-java6* packages, "java" couldn't be executed anylonger because /etc/alternatives/java was pointing to missing files:

rwxrwxrwx 1 root root 40 2008-02-24 13:40 /etc/alternatives/java -> /usr/lib/jvm/java-7-icedtea/jre/bin/java
lrwxrwxrwx 1 root root 37 2007-09-29 14:32 /etc/alternatives/javac -> /usr/lib/jvm/java-1.5.0-sun/bin/javac
lrwxrwxrwx 1 root root 39 2007-09-29 14:32 /etc/alternatives/javadoc -> /usr/lib/jvm/java-1.5.0-sun/bin/javadoc
lrwxrwxrwx 1 root root 37 2007-09-29 14:32 /etc/alternatives/javah -> /usr/lib/jvm/java-1.5.0-sun/bin/javah
lrwxrwxrwx 1 root root 37 2007-09-29 14:32 /etc/alternatives/javap -> /usr/lib/jvm/java-1.5.0-sun/bin/javap

I ran the following lines which I found in this ticket:
sudo update-java-alternatives --list
sudo update-java-alternatives --auto

and that fixed it.

It'd be very nice, though, if this was working out of the box.

Changed in sun-java6:
status: Fix Released → Confirmed
Revision history for this message
Bryan Quigley (bryanquigley) wrote :

Is anyone still getting this bug? Gutsy and Feisty are both unsupported now.

Revision history for this message
Nicolò Chieffo (yelo3) wrote :

not getting it in current versions

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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