Detailed resolution process of error reporting when installing JDK in tomcat
The following error occurred when unzipping and installing JDK when installing tomcat:
[root@localhost src] # wget 'http://download.oracle.com/otn-pub/java/jdk/8u65-b17/jdk-8u65-linux-i586.tar.gz'
-- 2016-01-18 04 21RV 56muri-http://download.oracle.com/otn-pub/java/jdk/8u65-b17/jdk-8u65-linux-i586.tar.gz
Parsing host download.oracle.com... 63.80.4.195, 63.80.4.169
Connecting download.oracle.com | 63.80.4.195 |: 80. Connected.
A HTTP request has been issued, waiting for a response. 302 Moved Temporarily
Location: https://edelivery.oracle.com/otn-pub/java/jdk/8u65-b17/jdk-8u65-linux-i586.tar.gz [follow to the new URL]
-- 2016-01-18 04 Fran 22v 03Mui-https://edelivery.oracle.com/otn-pub/java/jdk/8u65-b17/jdk-8u65-linux-i586.tar.gz
Parsing host edelivery.oracle.com... 23.37.150.140
Connecting edelivery.oracle.com | 23.37.150.140 |: 443. Connected.
A HTTP request has been issued, waiting for a response. 302 Moved Temporarily
Location: http://download.oracle.com/errors/download-fail-1505220.html [follow to the new URL]
-- 2016-01-18 04 Fran 22 purl 04 Mui-http://download.oracle.com/errors/download-fail-1505220.html
Connecting download.oracle.com | 63.80.4.195 |: 80. Connected.
A HTTP request has been issued and is waiting for a response. 200 OK
Length: 5307 (5.2K) [text/html]
Saving to: "jdk-8u65-linux-i586.tar.gz.1"
100% [= = >] 5307 -.-K in s 0.01s
2016-01-18 04:22:05 (388 KB/s)-saved "jdk-8u65-linux-i586.tar.gz.1" [5307 Unix 5307])
[root@localhost src] # ls
Httpd-2.2.31 jdk-8u65-linux-i586.tar.gz.1 nginx-1.8.0 php-5.4.44.tar.bz2
Httpd-2.2.31.tar.bz2 mysql-5.1.73-linux-i686-glibc23 nginx-1.8.0.tar.gz pure-ftpd-1.0.42
Jdk-8u65-linux-i586.tar.gz mysql-5.1.73-linux-i686-glibc23.tar.gz php-5.4.44 pure-ftpd-1.0.42.tar.bz2
[root@llocalhost src] # rm-rf jdk-8u65-linux-i586.tar.gz.1
[root@llocalhost src] # tar zxvf jdk-8u65-linux-i586.tar.gz # encountered the following error while decompressing
Gzip: stdin: not in gzip format
Tar: Child returned status 1
Tar: Error is not recoverable: exiting now
In fact, http://download.oracle.com/otn-pub/java/jdk/8u65-b17/jdk-8u65-linux-i586.tar.gz points to a page to download JDK, and the specific download package is actually in a link on this page, so running the above download command actually downloads a page of html. This can be verified with the file command.
[root@localhost src] # file jdk-8u65-linux-i586.tar.gz
Jdk-8u65-linux-i586.tar.gz: HTML document text # Note
So the reason for reporting the error is not that many blogs in Baidu are talking about the wrong decompression command.
-
Solutions to error reporting:
1 > download the installation package of JDK to a directory in windos first
2: > Log in to samba's shared directory, and then cut and paste the downloaded JDK installation package into samba's shared directory
3 > enter the created samba shared directory under linux, and you can see the installation package of JDK
[root@liuleilinux ~] # cd / tmp/sambadir/
[root@liuleilinux sambadir] # ls
1.txt jdk-8u65-linux-i586.tar.gz test
4 > then move the JDK installation package of / tmp/sambadir/ under the shared directory to / usr/local/sr
[root@liuleilinux sambadir] # cd
[root@liuleilinux ~] # mv / tmp/sambadir/jdk-8u65-linux-i586.tar.gz / usr/local/sr
[root@liuleilinux ~] # cd / usr/local/src/
[root@liuleilinux src] # ls
Httpd-2.2.31 mysql-5.1.73-linux-i686-glibc23 nginx-1.8.0.tar.gz pure-ftpd-1.0.42
Httpd-2.2.31.tar.bz2 mysql-5.1.73-linux-i686-glibc23.tar.gz php-5.4.44 pure-ftpd-1.0.42.tar.bz2
Jdk-8u65-linux-i586.tar.gz nginx-1.8.0 php-5.4.44.tar.bz2
5 > decompression succeeded
[root@liuleilinux src] # tar zxvf jdk-8u65-linux-i586.tar.gz
...
...
Dk1.8.0_65/jre/README
Jdk1.8.0_65/jre/COPYRIGHT
[root@liuleilinux src] # echo $?
0
Finally, we successfully unzip the JDK installation. I hope it can help you encounter the same problem.