CentOS7.0 installation JDK1.8

Source: Internet
Author: User

Http://www.centoscn.com/image-text/install/2015/0311/4856.html

JDK Download Address:

$> wget http://jjbig.jb51.net:8080/201704/tools/jdk-linux-x64.tar.gz

1. Check the JDK version in the system [Java] view plaincopy $>java-version java version "1.7.0_"
OpenJDK Runtime Environment (IcedTea6 1.11.1) (rhel-1.45.1.11.1.el6-x86_64)
OpenJDK 64-bit Server VM (build 20.0-b12, Mixed mode)

2. Test JDK installation package [Java] view Plaincopy $>rpm-qa | grep Java Avapackages-tools-3.4.1-6.el7_0.noarch
Tzdata-java-2014i-1.el7.noarch
Java-1.7.0-openjdk-headless-1.7.0.71-2.5.3.1.el7_0.x86_64
Java-1.7.0-openjdk-1.7.0.71-2.5.3.1.el7_0.x86_64
Python-javapackages-3.4.1-6.el7_0.noarch

3. Uninstall OpenJDK [Java]  view plaincopy   $>rpm -e --nodeps  tzdata-java-2014i-1.el7.noarch   $>rpm -e --nodeps  java-1.7.0-openjdk-headless-1.7.0.71-2.5.3.1.el7_0.x86_64   $>rpm -e --nodeps  java-1.7.0-openjdk-1.7.0.71-2.5.3.1.el7_0.x86_64   4. Install the new jdk1.8.0_31

Extract tar.gz [Java] view plaincopy $>mkdir-p/USR/LIB/JVM $>tar-zxvf jdk1.8.0_31.tar.gz-c/usr/lib/j VM 5. Set environment variable [Java] view plaincopy $> Vi/etc/profile at the end add: [Java] view plaincopy export J AVA_HOME=/USR/LIB/JVM/JDK1.8.0_31 Export JRE_HOME=${JAVA_HOME}/JRE Export Classpath=.:${java_home}/lib:${jre_home} /lib Export Path=${java_home}/bin: $PATH
6. Executive Profile [Java] view Plaincopy $>source/etc/profile

7. Check the newly installed JDK [Java] view Plaincopy $>java-version

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.