Linux server uninstalls native default installed JDK

Source: Internet
Author: User

1. Check the version of the system installation:

Rpm-qa |  -qa | grep GCJ

2. View and delete

[Email protected] ~]# rpm-qa|grep Jdkjava-1.6.0-openjdk-devel-1.6.0.0-1.41.1.10.4.5. Alios6.x86_64java-1.6.0-openjdk-1.6.0.0-1.41.1.10.4.5. Alios6.x86_64[[email protected]~]# rpm-e--nodeps java-1.6.0-openjdk-devel-1.6.0.0-1.41.1.10.4.5. Alios6.x86_64[[email protected]~]# rpm-e--nodeps java-1.6.0-openjdk-1.6.0.0-1.41.1.10.4.5. Alios6.x86_64[[email protected]~]# rpm-qa|grep GCJLIBGCJ-4.4.6-3.5. Alios6.x86_64[[email protected]~]# rpm-e--nodeps libgcj-4.4.6-3.5. Alios6.x86_64[[email protected]~]# Java-bash:/usr/bin/java:no such file or directory

3. Installing the JDK

3.1 Download JDK

Jdk7:http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html

3.2 Create the directory where the JDK is installed:

3.3 Unzip the file to the folder you created:

Tar zxvf  jdk-7u79-linux-x64.gz  -c/usr/local/java

3.4 Add the following command at the end of the profile file:

Vim/etc/profile

#JAVA_HOME
Export java_home=/usr/local/jdk1.7.0_79
Export path= $PATH: $JAVA _home/bin

3.5 Refreshing environment variables

Source/etc/profile

3.6 Testing Whether Java commands are available

Java-version

Complete

Linux server uninstalls native default installed JDK

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.