CentOS 6.5 Installation jdk1.8

Source: Internet
Author: User
CentOS 6.5 Installation jdk1.8
1, source Package preparation:


First to the official website download jdk-8u66-linux-x64.tar.gz,


Http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html


2, Upload
Upload to/data directory.


3, decompression
Tar zxvf jdk-8u66-linux-x64.tar.gz


4. Set JDK environment variables
Vi/etc/profile
After opening, add at the end:
Java_home=/data/jdk1.8.0_66
Jre_home=/data/jdk1.8.0_66/jre
Classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar: $JRE _home/lib
Path= $JAVA _home/bin: $PATH
Export PATH java_home CLASSPATH


5. Make environment variable effective
Source/etc/profile


6, to see if their configuration is correct


Echo $JAVA _home
Echo $CLASSPATH
Echo $PATH


7, modify the default JDK
Update-alternatives--install/usr/bin/java Java/data/jdk1.8.0_66/bin/java 300
Update-alternatives--install/usr/bin/javac Javac/data/jdk1.8.0_66/bin/javac 300
Update-alternatives--config Java
Update-alternatives--config Javac


8. Verify that the installation is successful


In the terminal
Java-version
See if the installation is successful and the success is shown below


Java Version "1.8.0_66"
Java (TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot (TM) 64-bit Server VM (build 25.65-b01, Mixed mode)
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.