Ubuntu installing Oracle JDK

To install Oracle Java on Ubuntu apply following commands;

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

test java

>java -version

tuna@tuna-VirtualBox:~$ java -version
java version “1.7.0_25”
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)

edit your environment and add JAVA_HOME
>sudo gedit /etc/environment

add this at the end JAVA_HOME=/usr/lib/jvm/java-7-oracle
save environment file


>echo $JAVA_HOME

tuna@tuna-VirtualBox:~$ echo $JAVA_HOME


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s