这是个大坑 平时装个JDK这么简单的事 在WSL上问题还真不少
安装环境适用于 Linux 的 Windows 子系统:
Ubuntu-18.04 (默认)
以前都是用的centos,直接yum localinstall ./jdk-???-linux-x64.rpm就可以安装本地的RPM包了。
但是现在使用的Ubuntu,只能安装DEB包,查询了一下有三种安装方式:RPM包转制为DEB包
使用开箱即用的tar.gz并配置环境变量
使用ppa源安装
开始安装sudo add-apt-repository ppa:webupd8team/java //添加PPA源
sudo apt-get update //更新本地包
sudo apt-get install oracle-java8-installer //安装JDK
// 很遗憾报错了
[email protected]:/wsl_share# apt-get install oracle-java8-installer
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package oracle-java8-installer is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'oracle-java8-ins