How to point environ var to JDK?

Is important if I install multiple JDK and then need to point a compile to the appropriate JDK (not necessarily default)

A common example is


When I install a JDK from Sun, it’s installed

into /usr/local/java/

But when I install a JDK from the SuSE repositories, I see various files installed into various bin directories.

What is the recommended path for instance if I install both JDK1.5 and JDK1.6?


There is an installed sub-system called “update-alternatives”
that handles this. See the man page ‘man update-alternatives’.

For example, execute the (root) cmd:
update-alternatives --config java
and you should see that java(s) are setup there, and you
can switch between them using this cmd.



That’s really good to know.

Haven’t seen that posted anywhere else.