Centos6.5 Download and install jdk1.8

Download link is below the image, it is recommended to use Thunder download
http://vault.centos.org/notonvault.html
Note: After installation, we need to update yum, enter yum update to complete, of course, we need to be performed as root user or will be error
such as: bE by You need to root to the perform the this the Command.
the After IS at The Complete Installation, Please RUN "yum Update" in the Order to Update your System.

Download jdk1.8 version via the link below, there is a corresponding server according to 32 or 64 downloads
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
a file upload and ready software and server software linked to the shell, and here I am using xftp and xshell
then we use xshell execute the following command in centos

# cd /usr/
# mkdir java
# cd java

After machining, the jdk tarball uploaded to the / usr / java directory and enter the following command to complete the decompression

tar -zxvf 输入你上传的压缩包名字

At this time we can see two blue file folder is by ll command, the red is compressed, and the way to delete archive
Here Insert Picture Description
is complete, we use the following command to modify the profile file

vim /etc/profile

Add the following code at the very bottom, we can i be inserted at the cursor position with the command, add it after the completion of press esc and enter: wq to exit the edit page (jdk1.8.0_241 This is based on your folder name to perform the corresponding modifications)

#java
export JAVA_HOME=/usr/java/jdk1.8.0_241
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib

Enter the following command to refresh the application profile file

source /etc/profile
java -version

If the FIG prompted, the system checks 64 or 32, corresponding to JDK. Here Insert Picture Description
And I did the wrong, you can use the following command in the current path to delete the wrong folder, unzip the file and re-upload

rm -rf 解压后的文件名

If not the wrong, enter java -version indicate the following prompt appears correctly install
Here Insert Picture Description
or use the following address yum install the JDK
https://blog.csdn.net/dhr201499/article/details/81626466

Released three original articles · won praise 0 · Views 35

Guess you like

Origin blog.csdn.net/u011614679/article/details/104106103