Operating System - Tru64 Unix
1753534 Members
4984 Online
108795 Solutions
New Discussion юеВ

How to know, which java version is the default

 
SOLVED
Go to solution
Michael Schulte zur Sur
Honored Contributor

How to know, which java version is the default

Hi,
I have java118 and java122 installed on Tru Unix 5.1A. How can I check, what is the default and how can I change it?
thanks for any insight
Michael
7 REPLIES 7
Dave Bechtold
Respected Contributor
Solution

Re: How to know, which java version is the default

Hi Michael,

To check it use.

# java -version


To change the default use.

Assuming 1.1.8 is the default currently.

This will first unset the current default of 1.1.8.

# /usr/opt/java118/bin/unset_java_default.sh

Now set 1.2.2 as the default use.

# /usr/opt/java122/bin/set_java_default.sh

Then recheck it.

# java -version


There is a unset_java_default.sh and a set_java_default.sh for versions 1.1.8 and higher under the /usr/opt/javaNNN/bin directory, where NNN is the major release number, i.e. 118, 122, 131. The scripts just change a symbolic link for /usr/bin/java .

FYI, this is documented in the release notes.

Hope this helps.

Dave Bechtold
Michael Schulte zur Sur
Honored Contributor

Re: How to know, which java version is the default

Thanks Dave,

this is a precise and clear answer.
ehem, I somewhat have an allergy against documentaion. ;-))
One thing though, 118 and 122 are installed.
Why is 118 the default and not the 122?
Usually you take the newest, right?

Michael
Michael Schulte zur Sur
Honored Contributor

Re: How to know, which java version is the default

Hello Dave,

forget my last question. I found the release notes. ;-)

Michael
Ralf Puchner
Honored Contributor

Re: How to know, which java version is the default

reading is always an option ;-)
Help() { FirstReadManual(urgently); Go_to_it;; }
Michael Schulte zur Sur
Honored Contributor

Re: How to know, which java version is the default

That??s true, Ralf.
Unfortunately I have read often docs in search for and answer to a question and I found none, that I developped a dislike for it. :-(
So I try, whenever possible to go without.
best regards
Michael
Thomas Sjolshagen
Occasional Advisor

Re: How to know, which java version is the default

V1.1.8 is the default because several OS components (sysman and lsmsa for instance) would have needed to be re-written to support V1.2.x.

As of V5.1b, V1.3.1 (fastvm) is the default jvm and the OS utilities that require V1.1.8 have been modified.

hth,

// Thomas
Abhijeet_4
New Member

Re: How to know, which java version is the default

Michael ,
However java -version doesnot give information about service release .
How to get info about service release

Best Regards
abhijeet