微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

centos6.5用wget的方式安装jdk,出现gzip: stdin: not in gzip format

1:最近买了一个阿里云服务器,需要安装jdk,然后呢,我就在百度搜到一篇用wget命令获取jdk的文章,连接如下:

http://jingyan.baidu.com/article/0aa2237555d0c488cc0d6438.html

按照它的方式:输入下面的命令,的确可以下载jdk

wget http://download:oracle.com/otn-pub/java/jdk/8u60-b27/jdk-8u60-linux-x64.tar.gz


2:然后按照它写的方式,将下载下来的jdk解压报错,报错信息如下:


[root@iZrj9bmsq801kry9n332hiZ ~]# tar xf jdk-8u60-linux-x64.tar.gz -C /usr/local/


gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting Now
[root@iZrj9bmsq801kry9n332hiZ ~]#


3:原因是:

The reason the file isn't extracting properly is because thedownload pageis setting a cookie when you accept the license agreement. If you don't have the session cookie when attempting to download the file,it redirects you to an HTML page that tells you to accept the agreement first. If you open the .tar.gz that you're getting fromwget,you'll see that it's an HTML file since it's not getting said cookie.

The easiest way to solve it is to download the file first,using your web browser,and then upload it to your web server.

上面的英文大致意思是:在Oracle官网下载jdk的时候,有个同意安装协议,但是用wget的方式,认是不同意,所以没法解压:


4:奉献上网页上下载jdk的截图,可以看到有个同意协议的单选按钮,认是不同意。


5:问题解决办法

从官网网页上下载jdk包,用xftp等ftp工具将jdk上传到阿里云服务器。

原文地址:https://www.jb51.cc/centos/380050.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。