Unix/Linux Go Back    

HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

Setting up new version of java


Thread Tools Search this Thread Display Modes
Old Unix and Linux 11-14-2017   -   Original Discussion by anaigini45
anaigini45's Unix or Linux Image
anaigini45 anaigini45 is offline
Registered User
Join Date: Oct 2009
Last Activity: 6 March 2018, 9:09 AM EST
Posts: 113
Thanks: 6
Thanked 0 Times in 0 Posts
Setting up new version of java


I have got jre 1.5 that I have got to install in the HP.UX version 11.31.
I managed to install it with this command :

# swinstall -s /tmp/<jre.XXXXX.depot>

It automatically gets created in /opt/java1.5/jre/bin.
However, now I am not sure how to set the PATH to JAVA_HOME, and path to this /opt/java1.5/jre/bin. Are these two the same?

Also I used this command to try and set the PATH (wrong path) :

export PATH=/opt/java1.5/bin:$PATH

I can now see /opt/java1.5/bin at the beginning of the line when I do an

#echo $PATH

However, since the entry is wrong, how do I remove it?

Also what is the difference between using the command above to set the PATH variable, and also setting it directly in /etc/PATH?

And how do I ensure that I get the output of java version 1.5 when I type this :

java -version

As of now, when I run the command above, it says "java not found".
In other servers on the other hand, I get different java versions when I run the same command.
Sponsored Links
Old Unix and Linux 11-27-2017   -   Original Discussion by anaigini45
vbe's Unix or Linux Image
vbe vbe is offline Forum Staff  
Join Date: Sep 2005
Last Activity: 19 March 2018, 4:12 AM EDT
Location: Switzerland - GE
Posts: 6,527
Thanks: 304
Thanked 559 Times in 521 Posts
I would rather use another variable for java such as JAVAPATH or JAVA6PATH etc... as you may need/want different versions even 32/64 bits etc...
setting java ( updating /etc/PATH) is not a good idea unless you have just that version.

Once you export a variable, it cannot be corrected other by giving it a new value...

You can use $JAVAPATH/java -version if you set the variable
Sponsored Links

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Setting java and returning version bigbenn Shell Programming and Scripting 1 07-10-2013 02:16 PM
Advanced Search * View * Edit JAVA version to WORK in GLASSFISH Forum topic JAVA version lhareigh890 UNIX for Advanced & Expert Users 1 02-10-2011 02:49 PM
Setting link to newly installed Java version harjitsingh Solaris 4 05-28-2008 11:25 AM

All times are GMT -4. The time now is 06:50 AM.