Linux online installation JDK plus configuration

Local offline installation reference: https://blog.csdn.net/qq_42049516/article/details/127515918

Install JDK online:
1. Download the installation package

wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.rpm

2. Executable permission

chmod +x jdk-8u131-linux-x64.rpm

3. Install

rpm -ivh jdk-8u131-linux-x64.rpm

4. Check

java -version

5. Environment variable configuration

vim /etc/profile

6. Add at the end of the file: i insert edit, complete Esc > :wq

JAVA_HOME=/usr/java/jdk1.8.0_201
CLASSPATH=$JAVA_HOME/lib/
PATH=$PATH:$JAVA_HOME/bin
export PATH JAVA_HOME CLASSPATH

7. If the file modification takes effect, if there are multiple users, source is required

source /etc/profile

8. Check

javac

Guess you like

Origin blog.csdn.net/qq_42049516/article/details/127515688