Uninstalling Linux comes with OPENJDK

Source: Internet
Author: User

1. View your own JDK version java-version

2. View Rpm-qa | grep java

The following information is displayed:

java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
Java-1.6.0-openjdk-1.6.0.0-1.7.b09.el5

Unloading:

RPM-E--nodeps java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
RPM-E--nodeps Java-1.6.0-openjdk-1.6.0.0-1.7.b09.el5

There are some other commands.

Rpm-qa | grep GCJ

Rpm-qa | grep JDK

If OpenJDK source cannot be found, you can also uninstall this

Yum-y Remove Java java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
Yum-y Remove Java Java-1.6.0-openjdk-1.6.0.0-1.7.b09.el5

3. Install Sun JDK

1> creating a Java folder under the USR folder

2> Copy the ****.jdk.gz uploaded by the client to the/usr/java folder

3> unzip the file tar xvf jdk.gz

4> Delete the file rm jdk.gz

5> Configuring environment variables

VI Open/etc/profile Add a statement at the end of the file

java_home=/usr/java/jdk1.7.0_79
Jre_home=/usr/java/jdk1.7.0_79/jre
Path= $JAVA _home/bin: $JRE _home/bin: $PATH
Classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar: $JRE _home/libexport java_home jre_home PATH CLASSPATH

Save, exit

6> Execute command java-version see if the JDK is installed successfully

  

[Email protected] etc]# java-version
Java Version "1.7.0_79"
Java (TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot (TM) 64-bit Server VM (build 24.79-b02, Mixed mode)

Uninstalling Linux comes with OPENJDK

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.