CentOS builds JDK environment

1. Download JDK1.8



 

 2. Upload the downloaded jdk package to the centos operating system through ssh

 

3. Unzip the installation package

tar -vxzf jdk-8u151-linux-x64.tar.gz

4. Edit system environment variables

vi /etc/profile

and add at the end of the file:

export JAVA_HOME=/usr/java/jdk8/jdk1.8.0_151   

export PATH=$JAVA_HOME/bin:$PATH



5. Execute the command. /etc/profile 

Note: There is a space between . and / here 

If the current directory is /etc/, then you can directly execute ./profile, where . and / have no spaces 

6. Enter java -version to test, the output is as follows, indicating that the installation is successful



 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326133043&siteId=291194637