在ubuntu 16.04上使用PPA下载Oracle Java 8

时间:2016-08-07 07:18:57

标签: java ubuntu-16.04

我一直在尝试下载Oracle Java 8,因为我需要它来安装android studio。这就是我所做的和我收到的:

atenagm@atenagm-K46CB:~$sudo add-apt-repository ppa:webupd8team/java
Oracle Java (JDK) Installer (automatically downloads and installs Oracle JDK7 / JDK8 / JDK9). There are no actual Java files in this PPA.

More info (and Ubuntu installation instructions):
- for Oracle Java 7: http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html
- for Oracle Java 8: http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html

Debian installation instructions:
- Oracle Java 7: http://www.webupd8.org/2012/06/how-to-install-oracle-java-7-in-debian.html
- Oracle Java 8: http://www.webupd8.org/2014/03/how-to-install-oracle-java-8-in-debian.html

Oracle Java 9 (for both Ubuntu and Debian):     http://www.webupd8.org/2015/02/install-oracle-java-9-in-ubuntu-linux.html

For JDK9, the PPA uses standard builds from:     https://jdk9.java.net/download/ (and not the Jigsaw builds!).

Important!!! For now, you should continue to use Java 8 because Oracle     Java 9 is available as an early access release (it should be released in  2016)! You should only use Oracle Java 9 if you explicitly need it,  because it may contain bugs and it might not include the latest security  patches! Also, some Java options were removed in JDK9, so you may  encounter issues with various Java apps. More information and installation  instructions (Ubuntu / Linux Mint / Debian):   http://www.webupd8.org/2015/02/install-oracle-java-9-in-ubuntu-linux.html
 More info: https://launchpad.net/~webupd8team/+archive/ubuntu/java
 Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keyring `/tmp/tmptvr_o5i2/secring.gpg' created
gpg: keyring `/tmp/tmptvr_o5i2/pubring.gpg' created
gpg: requesting key EEA14886 from hkp server keyserver.ubuntu.com
gpg: /tmp/tmptvr_o5i2/trustdb.gpg: trustdb created
gpg: key EEA14886: public key "Launchpad VLC" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
OK

atenagm@atenagm-K46CB:~$ sudo apt-get update
Get:1 http://archive.canonical.com lucid InRelease [8,460 B]
Get:2 http://ppa.launchpad.net/atareao/telegram/ubuntu xenial InRelease [17.5 kB]
Get:3 http://ppa.launchpad.net/maarten-fonville/android-studio/ubuntu xenial InRelease [17.6 kB]
Get:4 http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu xenial InRelease [17.5 kB]
Get:5 http://ppa.launchpad.net/paolorotolo/android-studio/ubuntu xenial InRelease [17.6 kB]
Get:6 http://ppa.launchpad.net/ubuntu-desktop/ubuntu-make/ubuntu xenial InRelease [17.6 kB]
Get:7 http://ppa.launchpad.net/webupd8team/java/ubuntu xenial InRelease [17.6 kB]
Get:8 http://us.archive.ubuntu.com/ubuntu xenial InRelease [247 kB]            
Hit:9 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease             
Get:10 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [92.2 kB]
Get:11 http://us.archive.ubuntu.com/ubuntu xenial-security InRelease [94.5 kB] 
Fetched 547 kB in 24s (22.5 kB/s)                                              
Reading package lists... Done
W: http://archive.canonical.com/dists/lucid/InRelease: Signature by key 630239CC130E1A7FD81A27B140976EAF437D05B5 uses weak digest algorithm (SHA1)

atenagm@atenagm-K46CB:~$ sudo apt-get install oracle-java8-installer
Reading package lists... Done
Building dependency tree       
Reading state information... Done
oracle-java8-installer is already the newest version (8u101+8u101arm-1~webupd8~2).
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 22 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up oracle-java6-installer (6u45-0~webupd8~8) ...
Downloading Oracle Java 6...
--2016-08-07 11:28:54--  http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-x64.bin
Resolving download.oracle.com (download.oracle.com)... 2.20.254.243, 2.20.254.251
Connecting to download.oracle.com   (download.oracle.com)|2.20.254.243|:80... connected.
HTTP request sent, awaiting response... 403 Forbidden
2016-08-07 11:28:55 ERROR 403: Forbidden.

download failed
Oracle JDK 6 is NOT installed.
dpkg: error processing package oracle-java6-installer (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up oracle-java7-installer (7u80+7u60arm-0~webupd8~1) ...
Downloading Oracle Java 7...
--2016-08-07 11:28:55--  http://download.oracle.com/otn-pub/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz
Resolving download.oracle.com (download.oracle.com)... 2.20.254.243, 2.20.254.251
Connecting to download.oracle.com  (download.oracle.com)|2.20.254.243|:80... connected.
HTTP request sent, awaiting response... 403 Forbidden
2016-08-07 11:28:56 ERROR 403: Forbidden.

download failed
Oracle JDK 7 is NOT installed.
dpkg: error processing package oracle-java7-installer (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up oracle-java8-installer (8u101+8u101arm-1~webupd8~2) ...
Using wget settings from /var/cache/oracle-jdk8-installer/wgetrc
Downloading Oracle Java 8...
--2016-08-07 11:28:56--  http://download.oracle.com/otn-pub/java/jdk/8u101-b13/jdk-8u101-linux-x64.tar.gz
Resolving download.oracle.com (download.oracle.com)... 2.20.254.243,  2.20.254.251
Connecting to download.oracle.com  (download.oracle.com)|2.20.254.243|:80... connected.
HTTP request sent, awaiting response... 403 Forbidden
2016-08-07 11:28:57 ERROR 403: Forbidden.

download failed
Oracle JDK 8 is NOT installed.
dpkg: error processing package oracle-java8-installer (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of oracle-java7-set-default:
 oracle-java7-set-default depends on oracle-java7-installer; however:
  Package oracle-java7-installer is not configured yet.

dpkg: error processing package oracle-java7-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-java7-set-default
E: Sub-process /usr/bin/dpkg returned an error code (1)

很抱歉,如果它太长但我真的不知道如何解决它。我感谢任何帮助。

提前致谢。

1 个答案:

答案 0 :(得分:1)

要安装oracle java 9,请按照以下步骤操作:

sudo apt-get install oracle-java9-installer
cd /var/lib/dpkg/info
sudo sed -i 's/=177/=179/' oracle-java9-installer.*
sudo sed -i 's/SHA256SUM_TGZ="a6905f3a4245a071880e1793b8d3d6100ef7b171ea1d6ebfe6312c25c2fca8bb"/SHA256SUM_TGZ="06fe58dfa50c4f6ca21dc1d475f16cd9e58db36b1d98582091d7ff9005dda7a7"/' oracle-java9-installer.*
sudo apt-get install oracle-java9-installer