CentOS Upgrade JDK

Source: Internet
Author: User

1. Download the appropriate version of the JDK:

wget--no-check-certificate--no-cookie--header "Cookie:oraclelicense=accept-securebackup-cookie;" http:// download.oracle.com/otn-pub/java/jdk/8u45-b14/jdk-8u45-linux-x64.rpm

Because the official website needs to register the login, so choose this code to download the corresponding version of the JDK;

2. Move the JDK to the appropriate CentOS directory:

MV Jdk-8u45-linux-x64.rpm/usr/java

3. Uninstall previous versions of JDK: delete this folder directly in the file directory

4. Install the new version of the JDK:

chmod 755 jdk-8u45-linux-x64.rpm//Add permissions to the installation package

RPM-IVH jdk-8u45-linux-x64.rpm//install JDK with RPM-IVH XXX command

5. View the environment variable configuration:

echo $PATH//If the path in the environment variable does not change, you need to manually configure the environment variable

[Email protected] desktop]# Vi/etc/profile

    1. Export java_home=/usr/java/jdk1.8.0_45
    2. Export Jre_home= $JAVA _home/jre
    3. Export path= $PATH: $JAVA _home/bin
    4. Export classpath=./: $JAVA _home/lib: $JAVA _home/jre/lib

: Wq//Save exit

6. Restart the server for the environment variable to take effect, and then view the JDK version:

[Email Protected]_18_87_centos ~]# java-version
Java Version "1.8.0_45"
Java (TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot (TM) 64-bit Server VM (build 25.45-b02, Mixed mode)

CentOS Upgrade JDK

Related Article

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.