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上传到阿里云服务器。

相关文章

Centos下搭建性能监控Spotlight
CentOS 6.3下Strongswan搭建IPSec VPN
在CentOS6.5上安装Skype与QQ
阿里云基于centos6.5主机VPN配置
CentOS 6.3下配置multipah
CentOS安装、配置APR和tomcat-native