0
votes

I am trying to install java on a Linux machine. I downloaded the file via wget http://download.oracle.com/otn-pub/java/jdk/7u72-b14/jdk-7u72-linux-x64.tar.gz

Then i tried the following command:

tar zxvf jdk-7u72-linux-x64.tar.gz

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

Can someone tell me how to install java on a Linux machine ? I get the above error, and i have no clue how to resolve it.

2
How big is the file. There are sometimes problems with using wget from oracle because they insist that you need to accept the license before downloading. - MTilsted
For Oracle Java...take a look here:webupd8.org/2012/01/… - Sameer Puri
Here is the official Java documentation on installing. You should follow the instructions. java.com/en/download/help/download_options.xml - AlvinJ
try installing it from the terminal using apt-get(Ubuntu) or whatever suits your platform, its a better alternative - Sainath S.R
I think you went to the download page in your browser, you selected the download url and pasted that in a wget command, right ? As a result you did not accept the download licence of oracle and you are redirected to this page: download.oracle.com/errors/download-fail-1505220.html. As a result you saved the html data as a .tar.gz file which is not in a gzip format. Download the jdk via the normal webpage on a linux box, or download it on your windows pc and copy the binary file (with scp?) to your linux box. - GerritCap

2 Answers

1
votes

Install Centos and send this on Putty:

yum install java7
0
votes

The downloaded file might get corrupted. You may need to download it again. You can check its header by typing

$ file jdk-7u72-linux-x64.tar.gz

The command should return something like "gzip compressed data". Also, you may try to check the file integrity by

$ gzip -t jdk-7u72-linux-x64.tar.gz