Ubuntu16.04 install jdk-8u144-linux-x64.tar.gz

0.卸载JDK:apt-get purge *jdk*

1.下载JDK:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
2.解压JDK:tar zxvf jdk-8u144-linux-x64.tar.gz
3.移动JDK:sudo mv jdk1.8.0_144 /opt/jdk

4.环境变量:

cd /etc/profile.d

sudo vim java-env.sh

 

export JAVA_HOME=/opt/jdk
export PATH=$PATH:$JAVA_HOME/bin

 

echo $JAVA_HOME

echo $PATH
source java-env.sh

echo $JAVA_HOME

echo $PATH


5.检测JDK:java -version

 

posted on 2017-09-19 11:21  唐先生_DowneyJr  阅读(318)  评论(0编辑  收藏  举报

导航