Install jdk 8 on Linux centos 7 operating system

 

Environment: install jdk 8 on the centos 7 operating system of Linux

 

1. Download

First go to the official website to download the compressed jdk file under Linux environment, the official website download address: http://www.oracle.com/technetwork/java/javase/downloads/index.html

I downloaded the jdk-8u151 version, and uploaded the downloaded jdk to Linux through tools such as xftp

2. Upload files

Upload files through ftp software, after uploading, my files are in /yunlian/source_soft/jdk-8u151-linux-x64.tar.gz

3. Decompression

Unzip the file using the command tar zxvf FileName.tar.gz

[root@xxx ~]# tar zxvf /yunlian/source_soft/jdk-8u151-linux-x64.tar.gz

 

Fourth, the environment variable configuration

After decompressing the file, you can configure the environment variables of java

Edit the /etc/profile file and add our java environment variable configuration information at the end of the file

[root@xxx ~]#  vi  /etc/profile

Press i to start editing the file and append the configuration content at the end of the file:

export JAVA_HOME=/yunlian/source_soft/jdk1.8.0_151

export PATH=$JAVA_HOME/bin:$PATH

 

After editing, press the Esc key to stop editing the file, and then continue to enter the command ":wq" to save and exit the editing mode

 

Execute the command [root@xxx ~]# source profile

This command can make the file just modified take effect immediately

 

Then, enter the commands java , javac , java -version respectively

If there is no command not found prompt message for the above three commands, it means the configuration is successful

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Guess you like

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