![下载适用于 Ubuntu 16.04 的 Oracle java 8 失败](https://linux22.com/image/884830/%E4%B8%8B%E8%BD%BD%E9%80%82%E7%94%A8%E4%BA%8E%20Ubuntu%2016.04%20%E7%9A%84%20Oracle%20java%208%20%E5%A4%B1%E8%B4%A5.png)
我试图安装 android studio 并且我需要,oracle java 8
但我的是openjdk
。在使用时sudo apt-get install oracle-java8-set-default
,我收到以下信息:
The following packages were automatically installed and are no longer required:
checkbox-ng icu-devtools iproute kde-l10n-engb kde-l10n-fa
libatk-wrapper-java libatk-wrapper-java-jni libbind9-90 libcamel-1.2-52
libcapnp-0.4.0 libcolamd2.8.0 libcommon-sense-perl libdns100
libebook-contacts-1.2-1 libecal-1.2-18 libedata-cal-1.2-27
libedataserver-1.2-20 libenca0 libgee2 libgif4 libglew1.10 libglewmx1.10
libgstreamer-plugins-base1.0-dev libgstreamer-vaapi1.0-0
libgstreamer-vaapi1.0-dev libgtop2-10 libicu-dev libimobiledevice4 libisc95
libisccc90 libisccfg90 libisl13 libjson-perl libjson-xs-perl libjsoncpp0v5
libllvm3.6v5:i386 liblouis2 liblwres90 libntdb1 libpgm-5.1-0 libpoppler52
libpth20 libqpdf13v5 libraw10 libscope-harness2 libsctp1 libset-scalar-perl
libsodium13 libtypes-serialiser-perl liburcu2 libusbmuxd2 libva-dev
libva-egl1 libva-glx1 libva-tpi1 libx265-59 libxml2-dev libzmq3
linux-headers-4.2.0-16 linux-headers-4.2.0-16-generic linux-headers-4.2.0-36
linux-headers-4.2.0-36-generic linux-headers-4.4.0-22
linux-headers-4.4.0-22-generic linux-image-4.2.0-16-generic
linux-image-4.2.0-36-generic linux-image-4.4.0-22-generic
linux-image-extra-4.2.0-16-generic linux-image-extra-4.2.0-36-generic
linux-image-extra-4.4.0-22-generic lksctp-tools python-cffi
python-characteristic python-dbus-dev python-ntdb python-ply
python-pycparser python-support python3-cffi python3-checkbox-ng
python3-colorama python3-ply python3-pycparser
qtdeclarative5-localstorage-plugin qtdeclarative5-qtfeedback-plugin
telepathy-indicator ubuntu-snappy-cli unity-scope-audacious
unity-scope-clementine unity-scope-gmusicbrowser unity-scope-gourmet
unity-scope-guayadeque unity-scope-musique upstart-bin
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 21 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
错误如下:
dpkg: error processing package oracle-java8-set-default (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
Errors were encountered while processing:
oracle-java6-installer
oracle-java7-installer
oracle-java8-installer
oracle-java8-set-default
E: Sub-process /usr/bin/dpkg returned an error code (1)
我猜这是由于我国的过滤造成的,我不知道该怎么做才能解决这个问题。你能帮助我吗?
答案1
尝试使用这个:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
希望有帮助
答案2
在ubuntu machine.online中安装java有两种方式(通过ppa)
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
并按照链接中给出的步骤离线。首先从 oracle 官方网站下载最适合您系统架构的 ubuntu jdk(tar.gz 文件),然后逐步执行步骤(在终端上复制说明)**确保在将其复制到终端时将整个 jdk...... 更改为您刚刚下载的 jdk 的文件名。显示的图像是旧的,因此无论 jdk 1.7.0_45 在哪里,都将其更改为正确的 jdk 版本(您可以按照步骤检查安装了哪个版本)
关联 :http://m.wikihow.com/Install-Java-on-Ubuntu
离线安装程序的优点:如果系统出现故障/重新安装,您可以再次安装,而且速度很快,而通过终端安装则需要时间,如果系统出现故障,您将需要再次上网重新安装