system does not see /usr/bin/java

Bug #208529 reported by Mike Basinger
4
Affects Status Importance Assigned to Milestone
command-not-found (Ubuntu)
Fix Released
Undecided
Unassigned
openjdk-6 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

After installing openjdk-6 I get the following trying to run java from the command line.

The program 'java' can be found in the following packages:
 * java-gcj-compat-headless
 * icedtea-java7-bin
 * j2re1.4
 * kaffe
 * cacao
 * gij-4.1
 * jamvm
 * gij-4.2
 * sablevm
Try: sudo apt-get install <selected package>
bash: java: command not found

java is in /usr/lib/jvm/java-6-openjdk/jre/bin/java, but is not link to /usr/bin/java that some program look for it at.

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

$ update-alternatives --list java ?

Changed in openjdk-6:
status: New → Incomplete
Revision history for this message
Mike Basinger (mike.basinger) wrote :

dbasinge@mikebuntu:~$ update-alternatives --list java
/usr/lib/jvm/java-6-openjdk/jre/bin/java

Changed in openjdk-6:
status: Incomplete → New
Revision history for this message
Vytas (vytas) wrote :

Same here
$ sudo update-alternatives --config java

There is only 1 program which provides java
(/usr/lib/jvm/java-6-openjdk/jre/bin/java). Nothing to configure.

$ java
The program 'java' can be found in the following packages:
 * java-gcj-compat-headless
 * icedtea-java7-bin
 * cacao
 * j2re1.4
 * kaffe
 * jamvm
 * gij-4.1
 * gij-4.2
 * sablevm
Try: sudo apt-get install <selected package>

Revision history for this message
Vytas (vytas) wrote :

I solved this by installing another javavm, jamvm (whatever would work I think, kaffe etc), then selecting it:

$ sudo update-alternatives --config java
There are 2 alternatives which provide `java'.

  Selection Alternative
-----------------------------------------------
 + 1 /usr/lib/jvm/java-6-openjdk/jre/bin/java
          2 /usr/bin/jamvm

Press enter to keep the default[*], or type selection number: 2
Using '/usr/bin/jamvm' to provide 'java'.

##########################

Then selecting openjdk again:

$ sudo update-alternatives --config java

There are 2 alternatives which provide `java'.

  Selection Alternative
-----------------------------------------------
 + 1 /usr/lib/jvm/java-6-openjdk/jre/bin/java
* 2 /usr/bin/jamvm

Press enter to keep the default[*], or type selection number: 1
Using '/usr/lib/jvm/java-6-openjdk/jre/bin/java' to provide 'java'.

##########################

Then I uninstalled jamvm, and it's fine now.

I think it's a bug that OpenJDK does not get configured automatically as java if there are no alternatives

Changed in openjdk-6:
status: New → Confirmed
Revision history for this message
Matthias Klose (doko) wrote :

this is unreproducible for me; the java link is installed on my system.

this message is from the command-not-found package and will be updated for hardy
The program 'java' can be found in the following packages:

Changed in openjdk-6:
status: Confirmed → Incomplete
Revision history for this message
Matthias Klose (doko) wrote :

$ LANG= /usr/lib/command-not-found --ignore-installed java
The program 'java' can be found in the following packages:
 * java-gcj-compat-headless
 * openjdk-6-jre-headless
 * j2re1.4
 * kaffe
 * cacao
 * gij-4.1
 * jamvm
 * gij-4.2
 * sablevm
Try: sudo apt-get install <selected package>

works in hardy

Changed in openjdk-6:
status: Incomplete → Fix Released
Changed in command-not-found:
status: New → Fix Released
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.