Linux (Centos 7) Install JDK and configure environment variables __linux

Source: Internet
Author: User
1. Download jdk files, such as jdk-8u131-linux-x64.tar.gz 2. Upload JDK files to Linux host 3 using tools such as FlashFXP . Install JDK

#切换root用户
[Sundy@centos7] Su root
......
# Extract JDK Files
[Root@centos7] TAR-ZXVF jdk-8u131-linux-x64.tar.gz
# move JDK files to the storage directory
[Root@centos7] mv./jdk1.8.0_131/opt/java/
# Configure Environment variables
[Root@centos7] Vim/etc/profile

Add the following at the end of the file

Export java_home=/opt/java/jdk1.8.1_131 
export classpath=.: $JAVA _home/jre/lib/rt.jar: $JAVA _home/lib/dt.jar:$ Java_home/lib/tools.jar 
export path= $PATH: $JAVA _home/bin

# Reload the/etc/profile file with the source command
[Root@centos7] Source/etc/profile
[Root@centos7] Java-version

Java version "1.8.0_131"
Java (tm) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot (tm) 64-bit Server VM ( Build 25.131-b11, 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.