change existing java from 1.5 to 1.6 on solaris 10 sparc

T

TsanChung

My solaris 10 sparc computer has java 1.5 and 1.6 installed.
How to change the existing java from 1.5 to 1.6?

# java -version
java version "1.5.0_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08)
Java HotSpot(TM) Client VM (build 1.5.0_01-b08, mixed mode, sharing)

# which java
/usr/bin/java

# ls -l /usr/bin/java
lrwxrwxrwx 1 root root 16 Aug 22 15:31 /usr/bin/java -
../java/bin/java

# ls -l /usr/jdk
total 12
drwxr-xr-x 4 root bin 512 Aug 22 11:24 instances
lrwxrwxrwx 1 root other 7 Mar 28 2005 j2sdk1.4.2_06 -
lrwxrwxrwx 1 root other 18 Mar 28 2005 jdk1.5.0_01 ->
instances/jdk1.5.0
lrwxrwxrwx 1 root root 21 Aug 22 11:28 jdk1.6.0_7 ->
instances/jdk1.6.0_07
lrwxrwxrwx 1 root root 10 Aug 22 11:32 latest ->
jdk1.6.0_7
drwxr-xr-x 7 root bin 512 Mar 28 2005 packages


# ls -l /usr/jdk/instances/
total 4
drwxr-xr-x 9 root bin 512 Aug 22 11:38 jdk1.5.0
drwxr-xr-x 10 tcma other 512 Aug 22 09:20 jdk1.6.0_07
 
A

Andreas Leitgeb

TsanChung said:
My solaris 10 sparc computer has java 1.5 and 1.6 installed.
How to change the existing java from 1.5 to 1.6?
# which java
/usr/bin/java
# ls -l /usr/bin/java
[...] /usr/bin/java -> ../java/bin/java

# ls -l /usr/java
[...] /usr/java -> jdk/jdk1.5.0_01
# ls -l /usr/jdk
drwxr-xr-x [...] instances
lrwxrwxrwx [...] j2sdk1.4.2_06 -> ../j2se
lrwxrwxrwx [...] jdk1.5.0_01 -> instances/jdk1.5.0
lrwxrwxrwx [...] jdk1.6.0_7 -> instances/jdk1.6.0_07
lrwxrwxrwx [...] latest -> jdk1.6.0_7
drwxr-xr-x [...] packages
# ls -l /usr/jdk/instances/
drwxr-xr-x [...] jdk1.5.0
drwxr-xr-x [...] jdk1.6.0_07

Calling this symlink-orgy a "mess" is probably an understatement ;-/
I assume they were forced to it for the infamous "hysterical raisins".

To solve it, you have these opportunities:
as root: change the symlink.
rm /usr/java; ln -s jdk/jdk1.6.0_7 /usr/java
(don't forget to delete the old symlink, or the new symlink
will be created somewhere else than in /usr)

as user:
create some $HOME/bin, make sure it's in the path, and link into
it all the important binaries from /usr/jdk/instances/jdk1.6.0_07
and finally make sure, that $HOME/bin is in your PATH.

as anyone:
Change the PATH variable to contain
/usr/jdk/instances/jdk1.6.0_07/bin
before /usr/bin (or /bin, which is usually the same on solaris)

First variant is perhaps the preferable one, because when you upgrade your
java version (to 1.6.0_10 some day), you only need to change one symlink,
and all new processes see the new Java.
 
A

Another Tom

TsanChung said:
My solaris 10 sparc computer has java 1.5 and 1.6 installed.
How to change the existing java from 1.5 to 1.6?

# java -version
java version "1.5.0_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08)
Java HotSpot(TM) Client VM (build 1.5.0_01-b08, mixed mode, sharing)

# which java
/usr/bin/java

# ls -l /usr/bin/java
lrwxrwxrwx 1 root root 16 Aug 22 15:31 /usr/bin/java -

# ls -l /usr/jdk
total 12
drwxr-xr-x 4 root bin 512 Aug 22 11:24 instances
lrwxrwxrwx 1 root other 7 Mar 28 2005 j2sdk1.4.2_06 -
lrwxrwxrwx 1 root other 18 Mar 28 2005 jdk1.5.0_01 ->
instances/jdk1.5.0
lrwxrwxrwx 1 root root 21 Aug 22 11:28 jdk1.6.0_7 ->
instances/jdk1.6.0_07
lrwxrwxrwx 1 root root 10 Aug 22 11:32 latest ->
jdk1.6.0_7
drwxr-xr-x 7 root bin 512 Mar 28 2005 packages


# ls -l /usr/jdk/instances/
total 4
drwxr-xr-x 9 root bin 512 Aug 22 11:38 jdk1.5.0
drwxr-xr-x 10 tcma other 512 Aug 22 09:20 jdk1.6.0_07
I believe patch 118666 and 118667 will do the trick.
 
A

Another Tom

TsanChung said:
My solaris 10 sparc computer has java 1.5 and 1.6 installed.
How to change the existing java from 1.5 to 1.6?

# java -version
java version "1.5.0_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08)
Java HotSpot(TM) Client VM (build 1.5.0_01-b08, mixed mode, sharing)

# which java
/usr/bin/java

# ls -l /usr/bin/java
lrwxrwxrwx 1 root root 16 Aug 22 15:31 /usr/bin/java -

# ls -l /usr/jdk
total 12
drwxr-xr-x 4 root bin 512 Aug 22 11:24 instances
lrwxrwxrwx 1 root other 7 Mar 28 2005 j2sdk1.4.2_06 -
lrwxrwxrwx 1 root other 18 Mar 28 2005 jdk1.5.0_01 ->
instances/jdk1.5.0
lrwxrwxrwx 1 root root 21 Aug 22 11:28 jdk1.6.0_7 ->
instances/jdk1.6.0_07
lrwxrwxrwx 1 root root 10 Aug 22 11:32 latest ->
jdk1.6.0_7
drwxr-xr-x 7 root bin 512 Mar 28 2005 packages


# ls -l /usr/jdk/instances/
total 4
drwxr-xr-x 9 root bin 512 Aug 22 11:38 jdk1.5.0
drwxr-xr-x 10 tcma other 512 Aug 22 09:20 jdk1.6.0_07
Sorry, I was incorrect about that. Those patches just change the update
version.
 
J

John D Groenveld

My solaris 10 sparc computer has java 1.5 and 1.6 installed.
How to change the existing java from 1.5 to 1.6?

# java -version
java version "1.5.0_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08)
Java HotSpot(TM) Client VM (build 1.5.0_01-b08, mixed mode, sharing)

# which java
/usr/bin/java

# ls -l /usr/bin/java
lrwxrwxrwx 1 root root 16 Aug 22 15:31 /usr/bin/java -

# ls -l /usr/jdk
total 12
drwxr-xr-x 4 root bin 512 Aug 22 11:24 instances
lrwxrwxrwx 1 root other 7 Mar 28 2005 j2sdk1.4.2_06 -
lrwxrwxrwx 1 root other 18 Mar 28 2005 jdk1.5.0_01 ->
instances/jdk1.5.0
lrwxrwxrwx 1 root root 21 Aug 22 11:28 jdk1.6.0_7 ->
instances/jdk1.6.0_07

I don't believe its safe to rely on /usr/bin/java to be any particular
Java version other than the one needed to support Sun's Java-based
applications bundled with the particular Solaris version installed.

Explicitely set JDK_HOME to /usr/jdk/instances/jdk1.6.0 and invoke
/usr/jdk/instances/jdk1.6.0/bin/java for your applications.

Happy hacking,
John
(e-mail address removed)
 
M

Martin Paul

TsanChung said:
My solaris 10 sparc computer has java 1.5 and 1.6 installed.
How to change the existing java from 1.5 to 1.6?

Look at /usr/java; it's a link to one of the Java instances under
/usr/jdk. By removing and re-creating the link to point at another
version of JDK, you can change the default.

I'm sure I once read that this is not a problem for Sun's Java
applications, as they will use /usr/jdk/... directly, but I don't
remember where it was. Looking at:

http://java.sun.com/javase/6/webnotes/install/jdk/install-solaris.html

... it talks about modifying /usr/java as well, but it's not 100% clear
either. I had modified /usr/java on my Solaris 9 systems to point at JDK
1.5 for quite some time, and didn't experience any problems.

mp.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top