Preface
Java Development Kit (JDK) is Sun's (acquired by Oracle) software development kit for Java developers. Since the introduction of Java, JDK has become the most widely used Java SDK (Software development kit)
Official website https://www.oracle.com/index.html
installation steps
1. Download the source code
https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html
Link: https://pan.baidu.com/s/1e0oNzoj1aYPB0Ucl0fG6Ew Password: 8ifh
Download and upload to the server root directory /opt
2. Unzip the source code
tar -zxvf jdk-8u144-linux-x64.tar.gz
3. Configure environment variables
vi /etc/profile
Press i in English input state to enter insert mode, add the following configuration
export JAVA_HOME=/opt/jdk1.8.0_144
export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
Press esc to enter : wq to save and exit, compile /etc/profile to make the configuration effective
source /etc/profile
4. Verify that the installation is successful
java -version
If a version number appears, it means success!