Linux (CENTOS7) Jdk complete installation steps

method one:

  In addition to this the following attached, there is a directly mounted via yum, this more convenient manner, the following installation jdk1.8 * Paste command:

yum install java-1.8.0-openjdk* -y

 After the above command completes, use the following command to see if the installation was successful:

java -version

Second way: 

1. Download jdk

        I am here under linux directory on disk after downloaded through the official online face from the window, downloaded.

        Version: the JDK-8u181-Linux-x64.tar.gz

2, unzip the downloaded jdk

        Create a folder:

mkdir -p /usr/lib/jvm

        Decompression (disk directory execute):

tar -zxvf jdk-8u181-linux-x64.tar.gz -C /usr/lib/jvm

3, set the environment variable

vim /etc/profile

        Add the top of the file:

export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_181  
export JRE_HOME=${JAVA_HOME}/jre  
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib  
export  PATH=${JAVA_HOME}/bin:$PATH

4, execution profile file

source /etc/profile

        This allows the configuration to take effect immediately without restarting.

 5, see the jdk version

java -version

Guess you like

Origin www.cnblogs.com/kawhileonardfans/p/10966546.html