redhat6.5 JDK Uninstall installation configuration

Source: Internet
Author: User
Tags syslog rabbitmq

Redhat Linux 6.5 When you install the JDK , you may have an older version of the JDK installed in your system , then uninstall the old version beforeinstalling the new version.

A. Uninstalling OpenJDK

[Email protected] ~]# java-version

Java Version "1.7.0_45"

OpenJDK Runtime Environment (rhel-2.4.3.3.el6-x86_64 u45-b15)

OpenJDK 64-bit Server VM (build 24.45-b08, Mixed mode)

[Email protected] ~]# Rpm-qa | grep JDK

Java-1.7.0-openjdk-1.7.0.45-2.4.3.3.el6.x86_64

Java-1.6.0-openjdk-1.6.0.0-1.66.1.13.0.el6.x86_64

[Email protected] ~]# Rpm-qa | grep GCJ

[Email protected] ~]# java-version

Java Version "1.7.0_45"

OpenJDK Runtime Environment (rhel-2.4.3.3.el6-x86_64 u45-b15)

OpenJDK 64-bit Server VM (build 24.45-b08, Mixed mode)

[Email protected] ~]# yum-y Remove java-1.7.0-openjdk-1.7.0.45-2.4.3.3.el6.x86_64 Loaded Plugins:product-id, Refresh-packagekit, security, Subscription-manager

This system isn't registered to Red Hat Subscription Management. You can use the Subscription-manager to register.

Setting up Remove Process

Resolving Dependencies

--Running Transaction check

---> Package java-1.7.0-openjdk.x86_64 1:1.7.0.45-2.4.3.3.el6 'll be erased

--Finished Dependency Resolution

Dependencies resolved

=============================================================================================================== =====

Package Arch Version Repository Size

=============================================================================================================== =====

Removing:

JAVA-1.7.0-OPENJDK x86_64 1:1.7.0.45-2.4.3.3.el6 @anaconda-redhatenterpriselinux-201311111358.x86_64/6.5 M

Transaction Summary

=============================================================================================================== =====

Remove 1 package (s)

Installed size:90 M

Downloading Packages:

Running Rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

Erasing:1:java-1.7.0-openjdk-1.7.0.45-2.4.3.3.el6.x86_64 1/1

Verifying:1:java-1.7.0-openjdk-1.7.0.45-2.4.3.3.el6.x86_64 1/1

Removed:

Java-1.7.0-openjdk.x86_64 1:1.7.0.45-2.4.3.3.el6

complete!

Two Installing Oracle JDK

Create the installation directory, set up the installation path under/usr/java, and test the file under this path:
Mkdir/usr/java

[[Email protected] usr]# CD

[[email protected] ~]# ls

Anaconda-ks.cfg Downloads jdk-7u79-linux-x64.rpm Pictures Templates

Desktop install.log jdk-7u79-linux-x64.tar.gz Public Videos

Documents Install.log.syslog Music rabbitmq-server-3.6.0-1.noarch.rpm

[Email protected] ~]# Cp-rjdk-7u79-linux-x64.rpm/usr/java

[[email protected] ~]# ls

Anaconda-ks.cfg Downloads jdk-7u79-linux-x64.rpm Pictures Templates

Desktop install.log jdk-7u79-linux-x64.tar.gz Public Videos

Documents Install.log.syslog Music rabbitmq-server-3.6.0-1.noarch.rpm

[Email protected] ~]# Cd/usr/java

[[email protected] java]# ls

jdk-7u79-linux-x64.rpm jdk-8u20-linux-x64.rpm

[Email protected] java]#

Upload the jdk-7u79-linux-x64.rpm to/usr/java. And then, to give jdk-7u79-linux-x64.rpm

Assign permissions, specifically to give it permission to execute, enter: chmod +x jdk-7u79-linux-x64.rpm

Start the Install command: RPM-IVH jdk-7u79-linux-x64.rpm

Preparing ... ###########################################[100%]

1:JDK ########################################### [100%]

Unpacking JAR files ...

Rt.jar ...

Jsse.jar ...

Charsets.jar ...

Tools.jar ...

Localedata.jar ...

Jfxrt.jar ...

[Email protected] java]#

2. Set environment variables.

#vi/etc/profile

Add input I to the last face

java_home=/usr/java/jdk1.7.0_79

Path= $JAVA _home/bin: $PATH

Classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar

Export Java_home

Export PATH

Export CLASSPATH

Save exit:

Press ESC:WQ to enter, restart login effective

Four. Verify that the environment variable is configured successfully

Input: Which Java gets the Java execution path, indicating that the configuration was successful

/usr/java/jdk1.7.0_79/bin/java

Input: Echo $JAVA _home

/usr/java/jdk1.7.0_79

[Email protected] ~]# echo $PATH

/usr/java/jdk1.7.0_79/bin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/ Root/bin

redhat6.5 JDK Uninstall installation configuration

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.