Install and configure JDK

1. Create a folder java in the /usr directory, mkdir java

 

2. cd java , execute the command wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie"  http://download.oracle.com/otn-pub/java/ If jdk/8u111-b14/jdk-8u111-linux-x64.tar.gz       does not have permission, add sudo.

 

3. Unzip the downloaded jdk-8u111-linux-x64.tar.gz    file, tar    -xzvf jdk-8u111-linux-x64.tar.gz    , if you do not have permission, add sudo. After completion, there will be a folder in the java directory    

jdk1.8.0_111

 

4. Configure the jdk environment variables. Enter the /etc directory, vi edit the profile file, add the following configuration at the end of the file and save:

JAVA_HOME=/usr/java/jdk1.8.0_111

CLASSPATH=$JAVA_HOME/lib/

PATH=$PATH:$JAVA_HOME/bin

export PATH JAVA_HOME CLASSPATH

 

5. Execute the java and java -version commands to see if the installation is successful

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326925589&siteId=291194637