Very confused as to what version of Java is in Feisty;(

NoOp glgxg at
Fri May 4 02:25:08 UTC 2007

On 05/02/2007 02:44 PM, John L Fjellstad wrote:
> Ghodmode <ghodmode at> writes:
>> I didn't know about the alternatives system.  I changed all of those
>> links manually.  I see from Scott's example how to update it to point
>> at a package.  How would I do it for a JDK that I installed manually?
> Check out the manual page for update-alternatives.
> You basically have to tell the alternatives system about your manual
> installation, and decide on what should be the master link and what the
> slaves are and the priority this version of JDK should have.

Along those same lines & somewhat related; if I do java -version or java
--version on one machine, I get:

:~/javascore$ java -version
bash: java: command not found

On all others I get a proper response.

So, I used:
sudo update-java-alternatives -a
(-a for auto) and now it shows up properly:

$ java -version
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)

$ sudo update-alternatives --config java

There are 2 alternatives which provide `java'.

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

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

Interesting part is that I just installed Sun JRE but it's not
showing up in alternatives. However if I use an application - OpenOffice
for instance and from OOo do Tools|Options||Java, both JRE
version 1.6.0 and show up.

So I guess I'm in the same cat as the OP, and find the 'which version'
confusing as well. Anyone have a link that helps explain how all of this
works on Ubuntu/Debian in basic terms?

More information about the ubuntu-users mailing list