gbcbr
asked on
JDK 1.6 on Solaris
I have Solaris 10 and I install JDK 1.6 into /usr/jdk but when I look at version by:
java -Xmx4096 -version
I was surprised with this reply:
java version "1.5.0_20"
Please advice how to remove old JDK versions and left only last one?
Thank you
java -Xmx4096 -version
I was surprised with this reply:
java version "1.5.0_20"
Please advice how to remove old JDK versions and left only last one?
Thank you
ASKER
NetBeans shows that it use 1.6, but I try to set -Xms on it and found 1.5
So, if I use Java only for NetBeans at the moment I can leave it as it is ?
Just advice how to put VM parameters in 1.6
So, if I use Java only for NetBeans at the moment I can leave it as it is ?
Just advice how to put VM parameters in 1.6
I'm not sure what you are asking.
If you add the /usr/jdk/bin to the search path
sh/bash
export PATH=/usr/jdk/bin:$PATH
csh
setenv path=/usr/jdk/bin:$path
Will change the behavior, you could also do alias java="/usr/jdk/bin/java"
If you add the /usr/jdk/bin to the search path
sh/bash
export PATH=/usr/jdk/bin:$PATH
csh
setenv path=/usr/jdk/bin:$path
Will change the behavior, you could also do alias java="/usr/jdk/bin/java"
ASKER
In /usr/jdk I have:
# cd /usr/jdk
# ls
instances jdk1.5.0_20 latest
j2sdk1.4.2_22 jdk1.6.0_21 packages
#
# cd /usr/jdk
# ls
instances jdk1.5.0_20 latest
j2sdk1.4.2_22 jdk1.6.0_21 packages
#
ASKER
apart of jdk I have also java and j2se in /usr
everything were installed with Solaris, this reason I ask how to clean it from unused old versions and leave one, new one
everything were installed with Solaris, this reason I ask how to clean it from unused old versions and leave one, new one
I would set JAVA_HOME to the one you want and then
export PATH=${JAVA_HOME}/bin:${PA TH}
export PATH=${JAVA_HOME}/bin:${PA
ASKER
# JAVA_HOME=/usr/jdk/jdk1.6. 0_21
# export PATH=${JAVA_HOME}/bin:${PA TH}
PATH=/usr/jdk/jdk1.6.0_21/ bin:/usr/s bin:/usr/b in: is not an identifier
#
# export PATH=${JAVA_HOME}/bin:${PA
PATH=/usr/jdk/jdk1.6.0_21/
#
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
# $JAVA_HOME
/usr/jdk/jdk1.6.0_21: cannot execute
# java -version
java version "1.6.0_21"
Java(TM) SE Runtime Environment (build 1.6.0_21-b06)
Java HotSpot(TM) Server VM (build 17.0-b16, mixed mode)
Ok, this is clear, but what to do with garbage?
/usr/jdk/jdk1.6.0_21: cannot execute
# java -version
java version "1.6.0_21"
Java(TM) SE Runtime Environment (build 1.6.0_21-b06)
Java HotSpot(TM) Server VM (build 17.0-b16, mixed mode)
Ok, this is clear, but what to do with garbage?
You can try like:
# which java
this will show the path for current java, eg. /usr/bin/java, normally this is a symbolic link.
To cleanup old java, just remove this link.
Then, create a symbolic link to your new java command where ever is:
# ln -s {new java path} /usr/bin/java (example only, depend on "which java" command output).
# which java
this will show the path for current java, eg. /usr/bin/java, normally this is a symbolic link.
To cleanup old java, just remove this link.
Then, create a symbolic link to your new java command where ever is:
# ln -s {new java path} /usr/bin/java (example only, depend on "which java" command output).
ASKER
# which java
/usr/jdk/jdk1.6.0_21/bin/j ava
so, now it's correct java and I can delete all old versions from jdk folder and leave only 1.6?
But what to do with folders java and j2se?
/usr/jdk/jdk1.6.0_21/bin/j
so, now it's correct java and I can delete all old versions from jdk folder and leave only 1.6?
But what to do with folders java and j2se?
Yes, you can delete all old java pathes/directoies, if you sure not going to use. But don't remove any packages if you don't know.
ASKER
Just for last confirmation before deleting:
I will leave in usr/jdk folder only two folders: 1.6 and packages and all other related to java delete, including folders java and j2se?
I will leave in usr/jdk folder only two folders: 1.6 and packages and all other related to java delete, including folders java and j2se?
Should be ok, but if you can copy/backup to somewhere else before delete just in case.
ASKER
you know that the best treatment for dandruff is a guilliotine :-)
ASKER
Thank you for real practical help!
Please check another my question about Java VM
Please check another my question about Java VM
run which java and you will likely see:
/usr/bin/java or /usr/local/bin/java.
Depending on your shell, you may need to do export PATH=/usr/jdk/bin:$PATH.
removing the older version should depend on whether it is needed for system management.
pkginfo
Locate the Java Pacakage
pkginfo -i or -l packagename will provide info on the package.
NOTE: be very careful with removing packages. SUNWjava is merely used as an example for the java package name.
pkgrm SUNWjava.