Linux (CentOS) install Java JDK----Source code installation __linux

Source: Internet
Author: User

1. Download and extract the source package (http://www.oracle.com/technetwork/cn/java/javase/downloads/jdk8-downloads-2133151-zhs.html)

wget http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/ Jdk-8u151-linux-x64.tar.gz? Authparam=1515723490_d67c6d22eb5101a0d4e9dbf0f7cf0bd4
mv Jdk-8u151-linux-x64.tar.gz\? Authparam\=1515723490_d67c6d22eb5101a0d4e9dbf0f7cf0bd4 jdk-8u151-linux-x64.tar.gz
Tar zxvf jdk-8u151-linux-x64.tar.gz
MV jdk1.8.0_151//usr/local/java/
2. Configure Environment variables

java_home=/usr/local/java/jdk1.8.0_151
jre_home=/usr/local/java/jdk1.8.0_151/jre
CLASS_PATH=.: $JAVA _ Home/lib/dt.jar: $JAVA _home/lib/tools.jar: $JRE _home/lib
path= $PATH: $JAVA _home/bin: $JRE _home/bin
Export Java_home jre_home Class_path PATH
3. Execute source/etc/profile to have its environment variable configured to take effect

4. Test: 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.