Java JRE will not install due to "tar: Error is not recoverable" error

I have been trying to get Java for the past day now. I followed several tutorials but I keep getting the same error. After I put in tar -xvf jre-7u4-linux-i586.tar.gz it says Cannot open: No such file or directory tar: Error is not recoverable: exiting now

I have a 64 bit system so I doubt that's the problem. The JDK installed perfectly, but I'm lost as to why the JRE wont work...


If OpenJDK isn't preferred, you can install the Oracle version from a ppa (which is a lot easier than manual installation, and you should also receive updates automatically). Adding via ppa also ensures that you are using the correct architecture (32 vs 64 bit).

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

Source: http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html

  • Are PPAs safe to add to my system and what are some "red flags" to watch out for?

The simplest way to get Java installed with Ubuntu 12.04 is to run

sudo apt-get install default-jdk

Do not mess with downloading any files - just use the package manager.


This set of instructions is for 64bit Java installation

Download Java to the Downloads folder

1 - Open Terminal, copy & paste the following commands

sudo mkdir -p -v /opt/java/64

Press Enter

cd Downloads && tar xvzf ~/Downloads/jre-7u4-linux-x64.tar.gz

Press Enter

sudo mv -v ~/Downloads/jre1.7.0_04 /opt/java/64

Press Enter

sudo update-alternatives --install "/usr/bin/java" "java" "/opt/java/64/jre1.7.0_04/bin/java" 1

Press Enter

sudo update-alternatives --set java /opt/java/64/jre1.7.0_04/bin/java

Press Enter

mkdir -v ~/.mozilla/plugins 

Press Enter

Now remove the IcedTea plugin, if it has been installed. If it's not there to begin with, you'll see a notification of that.

sudo apt-get remove icedtea6-plugin

Press Enter

Remove a former version of the Java plugin (may or may not be present, run the command just to make sure). If it's not there to begin with, you'll see a notification of that.

rm -v ~/.mozilla/plugins/libnpjp2.so

Press Enter

ln -s /opt/java/64/jre1.7.0_04/lib/amd64/libnpjp2.so ~/.mozilla/plugins/

Press Enter

These instructions were copied verbatim from the Easy Linux Tips Project

I have used these instructions myself and can verify that they do work.

Easy Linux Tips - Installing Oracle Java


Open Software Center and type jre there.

java


I had the same problem with a friends machine, all i did was to install the openjdk, this can be done using the below command

sudo apt-get install openjdk-7-oracle

The above command work in 12.04, but to previous version you either add some ppa, or just run the below command

sudo apt-get install openjdk-6-jdk

It worked for me and my friend.

Hope that helped.