简体   繁体   English

Ubuntu Java jdk 8 安装问题。 安装后安装java8的RPM发现openjkd 11

[英]Ubuntu Java jdk 8 Installation Issue. installed RPM of java8 after installed found openjkd 11

Hie, I am confused where I am messed up.嘿,我很困惑我在哪里搞砸了。

I have downloaded JDK and JRE rpm files from the Oracle download page.我已经从 Oracle 下载页面下载了 JDK 和 JRE rpm 文件。 I am using a 64-bit Linux machine ubuntu 18.04 os.我使用的是 64 位 Linux 机器 ubuntu 18.04 os。

here the file I have downloaded这里是我下载的文件在此处输入图片说明

I used alien to convert into .deb files and then I have used dpkg to install deb.我使用alien 转换成.deb 文件,然后我使用dpkg 安装deb。

I have installed JRE 1.8 .我已经安装了 JRE 1.8 。 and I have installed maven via command line.我已经通过命令行安装了 maven。 but after install, I found this surprisingly但安装后,我惊讶地发现了这一点

在此处输入图片说明

If you know the paths where Oracle packages with Java were installed, you can use update-alternatives to choose which Java you want to use.如果您知道带有 Java 的 Oracle 软件包的安装路径,则可以使用update-alternatives来选择要使用的 Java。 For example, in my case:例如,就我而言:

sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0_51/bin/java" 1

sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.8.0_51/bin/javac" 1

sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.8.0_51/bin/javaws" 1

and in the end:最后:

sudo update-alternatives --config java

and choose the the number of your Oracle Java installation.并选择您的 Oracle Java 安装编号。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM