By default ubuntu 12.04 comes with Openjdk. In this article, we can see how to install Oracle java 7 on ubuntu 12.04.
Step 1 » Check the version of java package installed by issuing the below commandkrizna@leela:~$ sudo update-java-alternatives -l
java-1.7.0-openjdk-i386 1051 /usr/lib/jvm/java-1.7.0-openjdk-i386
[OR]krizna@leela:~$ java -version
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.1) (6b24-1.11.1-4ubuntu3)
OpenJDK Client VM (build 20.0-b12, mixed mode, sharing)
The results shows openjdk is installed on your machine .
Step 2 » Remove openjdk by typing the below command .krizna@leela:~$ sudo apt-get purge openjdk*
Step 3 » Issue the below command to add webupd8 repository.krizna@leela:~$sudo add-apt-repository ppa:webupd8team/java
Step 4 » update the repositorieskrizna@leela:~$sudo apt-get update
Step 5 » Now install Oracle java7 by issuing the below command.krizna@leela:~$ sudo apt-get install oracle-java7-installer
Step 6 » That’s it, Now check the versionkrizna@leela:~$ java -version
java version "1.7.0_09"
Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
Java HotSpot(TM) Client VM (build 23.5-b02, mixed mode)
[OR]krizna@leela:~$ sudo update-java-alternatives -l
java-7-oracle 1 /usr/lib/jvm/java-7-oracle
Oracle Java7 is installed on ubuntu 12.04.
Is you had any problem installing the updated version, just remove all the installed java versions and try installing again.
» Just issue the below command to check the installed java versions.krizna@leela:~$ sudo update-java-alternatives -l
java-1.7.0-openjdk-i386 1051 /usr/lib/jvm/java-1.7.0-openjdk-i386
java-7-oracle 1 /usr/lib/jvm/java-7-oracle
Here we can see both Openjdk and Oracle java installed, we need to remove both inorder to perform a clean install .
» Issue the below commands one by one to remove other versions of java.krizna@leela:~$ sudo apt-get purge openjdk*
krizna@leela:~$ sudo apt-get purge icedtea*
krizna@leela:~$ sudo rm /var/lib/dpkg/info/oracle-java7-installer*
krizna@leela:~$ sudo apt-get purge oracle-java7-installer*
krizna@leela:~$ sudo rm /etc/apt/sources.list.d/*java*
Reboot the machine and continue from Step 3 to install Oracle java latest version.
Visual Studio Code is a popular code editor which is lightweight and cross platform application.…
MySQL workbench is a GUI tool for managing MySQL database system. It is used by…
Android Studio is a popular development software used especially for developing android applications. It is…
Google chrome is a most popular web browser developed by google. It was developed to…
Zoom is a popular video conferencing software. It is commonly used for conducting online meetings,…
TeamViewer is a popular application for desktop sharing and remote control. It is available for…