Celeb Glow
updates | March 27, 2026

Oracle Java Virtual Machine install?

I cant get it install and I need it running for a job application i need to put in online.

jre-7u51-linux-i586.tar.gz

that's the file and every time I try to install it wont complete, says cannot find file.

4 Answers

You can use

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

This will install Oracle JVM and will update it when needed.

But if you want to install JVM manually, you should use these commands:

tar -xzf jre-7u51-linux-i586.tar.gz
sudo mv jre1.7.0_51/ /usr/lib/jvm/jre1.7.0_51

Then run

sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jre1.7.0_51/jre/bin/java

and

$ sudo update-alternatives --config java
There are 3 choices for the alternative java (providing /usr/bin/java). Selection Path Priority Status
--------------------------------------------------------------------------------
* 0 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 auto mode 1 /usr/lib/jvm/ia32-java-6-sun/jre/bin/java 63 manual mode 2 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 manual mode 3 /usr/lib/jvm/java-6-sun/jre/bin/java 63 manual mode 4 /usr/lib/jvm/jre1.7.0_51/jre/bin/java 4 manual mode
Press enter to keep the current choice[*], or type selection number:

Follow the instructions on screen. Your numbers would be quite different from mine.

1

If you want to have Java 7, follow this:

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

Oracle java is better than the openjdk in terms of performance IMO

1

Now the commands should be:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update #(skip this line for Ubuntu 18.04)
sudo apt-get install oracle-java8-installer

oracle-java8-set-default will be installed automatically on Ubuntu. For other OSes, the last line should be

sudo apt-get install oracle-java8-installer oracle-java8-set-default

The sudo apt-get procedures don't currently work due to changes at Oracle. @Danatela had the best answer that worked for me. There is only one change to using his sudo update-alternatives --install command.

The command should include a priority value at the end so is looks like --install <link> <name> <path> <priority>

I updated the current JDK (complete file is jdk-12.0.2_linux-x64_bin.tar.gz) in the following command:

sudo update-alternatives --install /usr/bin/java java /usr/lib/java/jdk-12.0.2_51/bin/java 1

where link = /user/bin/java, name = java, path = /usr/lib/java/jdk-12.0.2_51/bin/java, and priority = 1 (auto)

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy