Sun Java JVM/JRE on Ubuntu Linux

Note that you should disable the Java plug-in in your browsers after installation.

Ubuntu >= 12.04

Java 11

sudo apt install openjdk-11-jre-headless

Java 10

sudo add-apt-repository ppa:linuxuprising/java
sudo apt-get update
sudo apt-get install oracle-java10-installer

Java 8

You probably want to get rid of OpenJDK (which is installed by default and leads to bad RubyMine performance):

sudo apt-get purge openjdk-\*

Now follow instructions in this article Show archive.org snapshot :

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

You can now check your default JVM with java -version.

It is possible to have multiple versions of java on the same machine. You can easily switch the system default java version:

sudo update-alternatives --config java

Note: Some programs rely on the $JAVA_HOME environment variable, which might differ from java -version. Run your program like this to avoid this problem: JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java /opt/your_program

Ubuntu 11.04 (Natty Narwhal)

  • In your Applications menu, open the Ubuntu Software Center.
  • Edit -> Software Sources -> Other Software
  • Check Canonical Partners and Canonical Partners Source Code

You probably want to get rid of OpenJDK (which is installed by default and leads to bad RubyMine performance):

sudo apt-get remove openjdk*

Now you can install the official Java JRE:

sudo apt-get update
sudo apt-get install sun-java6-jre 

You can now check your default JVM with java -version. It should be Sun's.

Ubuntu 10.10 (maverick)

This possibly works for versions below 10.10. If it does, please update this note.

sudo add-apt-repository ppa:sun-java-community-team/sun-java6

You probably want to get rid of OpenJDK (which is installed by default and leads to bad RubyMine performance):

sudo apt-get remove openjdk*

Now you can install the official Java JRE:

sudo apt-get update
sudo apt-get install sun-java6-jre 

You can now check your default JVM with java -version. It should be Sun's.

Ubuntu < 10.10

To install the Sun Java Virtual Machine (JVM) e.g. on Ubuntu Linux 9.10 (karmic):

Open /etc/apt/sources.list, put

deb http://archive.ubuntu.com/ubuntu/ karmic multiverse
deb-src http://archive.ubuntu.com/ubuntu/ karmic multiverse

You probably want to get rid of OpenJDK (which is installed by default and leads to bad RubyMine performance):

sudo apt-get remove openjdk*

Now you can install the official Java JRE:

sudo apt-get update
sudo apt-get install sun-java6-jre 

You can now check your default JVM with java -version. It should be Sun's.

Thomas Eisenbarth Over 13 years ago