Ubuntu安装、切换openjdk8
1.安装openjdk8sudo add-apt-repository ppa:openjdk/ppasudo apt-get updatesudo apt-get install openjdk-8-jdk2.配置#配置环境变量vim ~/.bashrc#在底部添加:export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64export JRE
·
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
更多推荐
已为社区贡献1条内容
所有评论(0)