Use alternatives to convert the java version-general Linux technology-Linux programming and kernel information. The following is a detailed description. After jdk was installed, java and javac were replaced with the java and javac of gij in/usr/bin.
Some people on the Internet said that they could use a tool named alternativs to migrate the software version in linux. They decided to use alternatives to migrate the jdk from gij to my newly installed jdk6.0.
Alternatives is in the/usr/sbin directory.
First, add the newly installed jdk to alternatives:
Then, use the -- display option to view the available JDK of the current system:
[Root @ djn-laptop sbin] #./alternatives -- display java
Java-the status is manual.
The link currently points to/usr/share/jdk1.6.0 _ 02/bin/java
/Usr/lib/jvm/jre-1.4.2-gcj/bin/java-1420 priority
From the keytool:/usr/lib/jvm/jre-1.4.2-gcj/bin/keytool
From rmiregistry:/usr/lib/jvm/jre-1.4.2-gcj/bin/rmiregistry
From jre_exports:/usr/lib/jvm-exports/jre-1.4.2-gcj
From jre:/usr/lib/jvm/jre-1.4.2-gcj
/Usr/share/jdk1.6.0 _ 02/bin/java-300 priority
From keytool :( null)
From rmiregistry :( null)
From jre_exports :( null)
From jre :( null)
Currently, the "best" version is/usr/lib/jvm/jre-1.4.2-gcj/bin/java.
[Root @ djn-laptop sbin] #./alternatives -- display javac
Javac-the status is manual.
The link currently points to/usr/share/jdk1.6.0 _ 02/bin/javac
/Usr/lib/jvm/java-1.4.2-gcj/bin/javac-1420 priority
Appletviewer:/usr/lib/jvm/java-1.4.2-gcj/bin/appletviewer
From jar:/usr/lib/jvm/java-1.4.2-gcj/bin/jar
From jarsigner:/usr/lib/jvm/java-1.4.2-gcj/bin/jarsigner
From javadoc:/usr/lib/jvm/java-1.4.2-gcj/bin/javadoc
From javah:/usr/lib/jvm/java-1.4.2-gcj/bin/javah
From rmic:/usr/lib/jvm/java-1.4.2-gcj/bin/rmic
From java_sdk_exports:/usr/lib/jvm-exports/java-1.4.2-gcj
From java_sdk:/usr/lib/jvm/java-1.4.2-gcj
/Usr/share/jdk1.6.0 _ 02/bin/javac-300 priority
From appletviewer :( null)
From jar :( null)
From jarsigner :( null)
From javadoc :( null)
From javah :( null)
From rmic :( null)
From java_sdk_exports :( null)
From java_sdk :( null)
The current "best" version is/usr/lib/jvm/java-1.4.2-gcj/bin/javac.
After confirmation, you can use the -- config parameter to select the JDK you want to use:
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.