- ubuntu 安装jdk8
- 七牛云存储拉取jdk8
wget http://qiniudns.2fei.top/jdk-8u212-linux-x64.tar.gz
root@VM-0-3-ubuntu:/usr/local# vim /etc/profile
if [ "${PS1-}" ]; then
if [ "${BASH-}" ] && [ "$BASH" != "/bin/sh" ]; then
# The file bash.bashrc already sets the default PS1.
# PS1='\h:\w\$ '
if [ -f /etc/bash.bashrc ]; then
. /etc/bash.bashrc
fi
else
if [ "`id -u`" -eq 0 ]; then
PS1='# '
else
PS1='$ '
fi
fi
fi
if [ -d /etc/profile.d ]; then
for i in /etc/profile.d/*.sh; do
if [ -r $i ]; then
. $i
fi
done
unset i
fi
#jdk 安装目录
JAVA_HOME=/usr/local/java8
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME PATH
#重启配置文件立即生效
source /etc/profile
#查看安装版本
root@VM-0-3-ubuntu:/usr/local# java -version
java version "1.8.0_212"
Java(TM) SE Runtime Environment (build 1.8.0_212-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.212-b10, mixed mode)