Skip to content
[dk]

~/blog/install-java-ubuntu-12-04.md

Installing Oracle (Sun) Java on Ubuntu 12.04

This post was written more than 14 years ago. Some of it may be out of date.

On Ubuntu 12.04, only OpenJDK is available by default. I wanted to try IntelliJ this time, and when I installed it, the startup warning recommended Sun Java, so I decided to install it.

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

After entering the commands above, the Java installer starts. Just follow the prompts. Once the installation is finished, check the Java version with the command below.

$ java -version

If it prints something like the following, the installation succeeded.

java version "1.7.0_07"
Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
Java HotSpot(TM) Client VM (build 23.3-b01, mixed mode)

$ related --same-tags

cd .. Back to all posts