1. Download the JDK
Download the JDK address: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Method One:
Use the command-line download in Linux:
(Note: URL fill in the specific address of the JDK version you need to download)
wget--no-cookies--no-check-certificate--header "COOKIE:GPW_E24=HTTP%3A%2F%2FWWW.ORACLE.COM%2F; Oraclelicense=accept-securebackup-cookie "" Http://download.oracle.com/otn-pub/java/jdk/8u5-b13/jre-8u5-linux-x64.tar.gz "
Method Two:
After the Windows system has downloaded the JDK version, it is uploaded to the Linux system
Rz-eb
2. Unzip the JDK
3. Configuring Java Environment Variables First step: Modify the/etc/profile file
Vi/etc/profile
Append the following to the end of the file:
#set java environmentjava_home=/usr/jdk1.8.0_20classpath=.: $JAVA _home/lib.tools.jarpath= $JAVA _home/bin:$ Pathexport java_home CLASSPATH PATH
Step Two: Create a new/etc/profile.d/java.sh file (all users have permission to use this environment variable)
vi/etc/profile.d/java.sh
#set java environmentjava_home=/usr/jdk1.8.0_20classpath=.: $JAVA _home/lib.tools.jarpath= $JAVA _home/bin:$ Pathexport java_home CLASSPATH PATH
Step three: Make the environment variable effective
source/etc/profilesource/etc/profile.d/java.sh
4. See if the Java environment variable is configured successfully
Java-version
See the following to illustrate the success of the environment variable configuration:
[Email protected] profile.d]# java-version
Java Version "1.8.0_20"
Java (TM) SE Runtime Environment (build 1.8.0_20-b26)
Java HotSpot (TM) 64-bit Server VM (build 25.20-b23, Mixed mode)
Linux system installation and configuration JDK