概述
来源:https://www.linuxuprising.com/2018/04/install-oracle-java-10-in-ubuntu-or.html
安装步骤如下:
1添加源
sudo add-apt-repository ppa:linuxuprising/java
sudo apt update
2.安装jdk10
sudo apt install oracle-java10-installer
3.安装成功如果要,切换过去版本,执行以下命令
sudo apt remove oracle-java10-set-default
4.按照以下命令选择过去版本
sudo update-alternatives --config java
sudo update-alternatives --config javac
sudo update-alternatives --config javaws
sudo update-alternatives --config javap
sudo update-alternatives --config javadoc
sudo update-alternatives --config jar
5.如果重新切换到jdk10,输入以下命令
sudo apt install oracle-java10-set-default
PS:
附加安装成功后目录
update-alternatives: using /usr/lib/jvm/java-10-oracle/bin/jaotc to provide /usr/bin/jaotc (jaotc) in auto mode
update-alternatives: using /usr/lib/jvm/java-10-oracle/bin/jdeprscan to provide /usr/bin/jdeprscan (jdeprscan) in auto mode
update-alternatives: using /usr/lib/jvm/java-10-oracle/bin/jhsdb to provide /usr/bin/jhsdb (jhsdb) in auto mode
update-alternatives: using /usr/lib/jvm/java-10-oracle/bin/jimage to provide /usr/bin/jimage (jimage) in auto mode
update-alternatives: using /usr/lib/jvm/java-10-oracle/bin/jlink to provide /usr/bin/jlink (jlink) in auto mode
update-alternatives: using /usr/lib/jvm/java-10-oracle/bin/jmod to provide /usr/bin/jmod (jmod) in auto mode
update-alternatives: using /usr/lib/jvm/java-10-oracle/bin/jshell to provide /usr/bin/jshell (jshell) in auto mode
update-alternatives: using /usr/lib/jvm/java-10-oracle/bin/jweblauncher to provide /usr/bin/jweblauncher (jweblauncher) in auto mode
update-alternatives: using /usr/lib/jvm/java-10-oracle/bin/javaws.real to provide /usr/bin/javaws.real (javaws.real) in auto mode
如果修改生效,执行下面命令修改下
1、sudo vim /etc/environment,然后编辑下,增加一行JAVA_HOME="/usr/lib/jvm/java-10-oracle
2、source /etc/environment
最后
以上就是称心睫毛膏为你收集整理的ubuntu 安装JDK10的全部内容,希望文章能够帮你解决ubuntu 安装JDK10所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复