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 the download page is 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 from wget, 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上传到阿里云服务器。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值