centos7 install jdk

centos7 install jdk

Download jdk jdk-8u151-linux-x64.tar.gz and
put it in the /usr/local directory

Unzip the tar -zxvf jdk-8u151-linux-x64.tar.gz

Modify /etc/profile and add at the end of the file

JAVA_HOME=/usr/local/jdk1.8.0_151/
CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
PATH=$PATH:$JAVA_HOME/bin

 

To make the above changes take effect, the command line executes source /etc/profile

Guess you like

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