1.安装openjdk8

sudo add-apt-repository ppa:openjdk/ppa
sudo apt-get update
sudo apt-get install openjdk-8-jdk

2.配置

#配置环境变量
vim ~/.bashrc
#在底部添加:
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export JRE_HOME=${JAVA_HOME}/jre
export PATH=${JAVA_HOME}/bin:$PATH
export CLASSPATH=.:${AVA_HOME}/lib:${JRE_HOME}/lib

#如果之前已经安装了其它版本的jdk,则需要修改javadoc
cd /etc/alternatives
rm javadoc
rm javadoc.1.gz
ln /usr/lib/jvm/java-8-openjdk-amd64/bin/javadoc* javadoc
ln /usr/lib/jvm/java-7-openjdk-amd64/man/man1/javadoc.1.gz javadoc.1.gz
Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐