CentOS安装JDK、JRE遇到open of <html> failed: No such

原创
2016/06/04 18:49
阅读数 3.9K

当我们从Oracle上accept license后右键复制链接地址,然后在centOS上使用wget下载之后,rpm安装时出现

open of <html> failed: No such file or directory

错误如下

$ java -version
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.11.90) (amazon-62.1.11.11.90.55.amzn1-x86_64)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

$ wget http://download.oracle.com/otn-pub/java/jdk/7u1-b08/jdk-7u1-linux-i586.rpm

$ ls
jdk-7u1-linux-i586.rpm

$ ls -al jdk-7u1-linux-i586.rpm 
 -rw-rw-r-- 1 username username 5307 Mar 20  2012 jdk-7u1-linux-i586.rpm

$ sudo rpm -i jdk-7u1-linux-i586.rpm 
error: open of <html> failed: No such file or directory
error: open of <head> failed: No such file or directory
error: open of <title>Unauthorized failed: No such file or directory
error: open of Request</title> failed: No such file or directory
error: open of <META failed: No such file or directory
error: open of NAME=ROBOTS failed: No such file or directory

这时候我们再看下下载的信息:

Resolving download.oracle.com... 23.62.239.25, 23.62.239.8
Connecting to download.oracle.com|23.62.239.25|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://edelivery.oracle.com/otn-pub/java/jdk/7u1-b08/jdk-7u1-linux-i586.rpm [following]
--2013-10-14 18:16:43--  https://edelivery.oracle.com/otn-pub/java/jdk/7u1-b08/jdk-7u1-linux-i586.rpm
Resolving edelivery.oracle.com... 23.65.6.140
Connecting to edelivery.oracle.com|23.65.6.140|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.oracle.com/errors/download-fail-1505220.html [following]
--2013-10-14 18:16:45--  http://download.oracle.com/errors/download-fail-1505220.html
Connecting to download.oracle.com|23.62.239.25|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5307 (5.2K) [text/html]
Saving to: ‘jdk-7u1-linux-i586.rpm’

注意看这里:

Length: 5307 (5.2K) [text/html]

这是因为Oracle上的链接地址并非最终下载地址,下载的只是一个HTML文档,但被命名为**.rpm所以会引起困惑。

如果下载tar.gz遇到不能解压的情况,也是相同原因。

 

解决方法:

定位到真实的下载地址,比如使用firefox默认下载

在Oracle网站上直接【点击下载】

 

然后再【复制下载链接】

使用wget 与这个链接 就能获取到真正的安装包(解压包)

因为下载链接会加上一个Oracle的时间戳,所以有下载的时间限制。

这时文件名称不是我们需要的.rpm,这时候通过mv oldpackage newpackage来重命名

然后就可以安装使用了

 

参考资料:http://serverfault.com/questions/545982/installing-jdk-on-amazon-linux-box-gives-error-open-of-html-failed-no-such-f

展开阅读全文
打赏
1
0 收藏
分享

作者的其它热门文章

加载中
666,就是这个原因
2017/10/12 18:43
回复
举报
更多评论
打赏
1 评论
0 收藏
1
分享
返回顶部
顶部