在Centos下使用wget方式下载java8压缩包后解压时提示:
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
因为这个压缩包并不是真正的tar.gz文件。这是一个下载链接,而压缩包真正的地址不是这个。
解决方法:在wget和压缩包地址之间添加如下语句:
--no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie"
即:wget --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" ${JAVA_URL}