我安装操作系统后就安装了 OpenJDK。
然后我下载了 IntelliJ IDEA 并尝试运行它。它显示一条警告,指出 IDEA 存在 OpenJDK 的已知图形问题,我应该安装 Oracle JDK。
除了字体和其他 UI 元素渲染效果不佳外,IDEA 运行良好。我想改善用户体验,因此决定安装 Oracle JDK。谷歌搜索了一些关键字,我找到了这一页。
我按照给定页面上的说明进行操作,但安装失败并出现以下错误:
$ sudo apt-get install oracle-java7-installer
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
diffstat libclucy-clojure linux-headers-3.2.0-26-generic linux-headers-3.2.0-26 dh-apparmor icedtea-netx-common
dkms clojure-contrib html2text libmail-sendmail-perl libsys-hostname-long-perl clojure1.2
Use 'apt-get autoremove' to remove them.
Suggested packages:
visualvm ttf-kochi-gothic ttf-sazanami-gothic ttf-kochi-mincho ttf-sazanami-mincho ttf-arphic-uming
The following packages will be upgraded:
oracle-java7-installer
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/15.3 kB of archives.
After this operation, 3,072 B of additional disk space will be used.
Setting up oracle-java7-installer (7u3-0~eugenesan~precise4) ...
Downloading...
--2012-08-16 00:39:21-- http://download.oracle.com/otn-pub/java/jdk/7u3-b04/jdk-7u3-linux-x64.tar.gz
Resolving download.oracle.com (download.oracle.com)... 1.186.191.202, 1.186.191.200
Connecting to download.oracle.com (download.oracle.com)|1.186.191.202|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://edelivery.oracle.com/otn-pub/java/jdk/7u3-b04/jdk-7u3-linux-x64.tar.gz [following]
--2012-08-16 00:39:21-- https://edelivery.oracle.com/otn-pub/java/jdk/7u3-b04/jdk-7u3-linux-x64.tar.gz
Resolving edelivery.oracle.com (edelivery.oracle.com)... 23.57.126.174
Connecting to edelivery.oracle.com (edelivery.oracle.com)|23.57.126.174|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.oracle.com/errors/download-fail-1505220.html [following]
--2012-08-16 00:39:22-- http://download.oracle.com/errors/download-fail-1505220.html
Connecting to download.oracle.com (download.oracle.com)|1.186.191.202|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5307 (5.2K) [text/html]
Saving to: `./jdk-7u3-linux-x64.tar.gz'
0K ..... 100% 213K=0.02s
2012-08-16 00:39:22 (213 KB/s) - `./jdk-7u3-linux-x64.tar.gz' saved [5307/5307]
Download done.
sha256sum mismatch jdk-7u3-linux-x64.tar.gz
Oracle JDK 7 is NOT installed.
dpkg: error processing oracle-java7-installer (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
oracle-java7-installer
E: Sub-process /usr/bin/dpkg returned an error code (1)
现在的状态是我没有安装Oracle JDK,我的系统apt-get
很乱,运行sudo apt-get upgrade
出现以下错误:
missingfaktor@thousand-sunny:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
oracle-java7-installer
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/15.3 kB of archives.
After this operation, 3,072 B of additional disk space will be used.
Do you want to continue [Y/n]? Y
Setting up oracle-java7-installer (7u3-0~eugenesan~precise4) ...
Downloading...
--2012-08-16 01:28:37-- http://download.oracle.com/otn-pub/java/jdk/7u3-b04/jdk-7u3-linux-x64.tar.gz
Resolving download.oracle.com (download.oracle.com)... 1.186.191.202, 1.186.191.200
Connecting to download.oracle.com (download.oracle.com)|1.186.191.202|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://edelivery.oracle.com/otn-pub/java/jdk/7u3-b04/jdk-7u3-linux-x64.tar.gz [following]
--2012-08-16 01:28:37-- https://edelivery.oracle.com/otn-pub/java/jdk/7u3-b04/jdk-7u3-linux-x64.tar.gz
Resolving edelivery.oracle.com (edelivery.oracle.com)... 23.57.126.174
Connecting to edelivery.oracle.com (edelivery.oracle.com)|23.57.126.174|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.oracle.com/errors/download-fail-1505220.html [following]
--2012-08-16 01:28:37-- http://download.oracle.com/errors/download-fail-1505220.html
Connecting to download.oracle.com (download.oracle.com)|1.186.191.202|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5307 (5.2K) [text/html]
Saving to: `./jdk-7u3-linux-x64.tar.gz'
0K ..... 100% 220K=0.02s
2012-08-16 01:28:37 (220 KB/s) - `./jdk-7u3-linux-x64.tar.gz' saved [5307/5307]
Download done.
sha256sum mismatch jdk-7u3-linux-x64.tar.gz
Oracle JDK 7 is NOT installed.
dpkg: error processing oracle-java7-installer (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
oracle-java7-installer
E: Sub-process /usr/bin/dpkg returned an error code (1)
由于很多原因,我需要这个命令才能工作。所以我有两个问题:
- 我需要做什么才能使其
apt-get
功能像以前一样? - 如何安装 Oracle JDK,建议这样做吗?
答案1
Pear Linux 论坛上的 @Fr0zen 帮助解决了这个问题。查找讨论这里。