Skip to main content

How to Install Java on Ubuntu

This article is about installing the Oracle Java JDK7 (Java Development Kit 7) on the Ubuntu Operating System.

Everybody knows that Sun Java was migrated to Oracle Java with Open source licence. Similarly IBM and Open source community has their own standard Java JDK. I personally prefer Oracle's Java JDK, Since majority of the cooperates uses Oracle JDK,I also recommend Ubuntu Java beginners to start with Oracle JDK. So don't confuse while downloading/Installing Oracle Java JDK.The following steps will guide you to install Oracle JDK in Ubuntu in a very easy manner.

To install Oracle JDK in Ubuntu, Advanced Package Tools (apt) provides the many providers for oracle. The webupd8team provider provides the following command to install the Oracle JDK.

To install Oracle JDK 7, execute the following commands in the terminal.

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

By executing the above command in the terminal, we installed Java in Ubuntu, But we still need to  set the environment variables. To set the JAVA_HOME environment variable, execute the following commands in the terminal.

sudo update-alternatives --config java

This will return the installed java version in the system.

There are 1 choices for the alternative java (providing /usr/bin/java).
Selection   Path                                       Priority   Status
-----------------------------------------------------------------------------
  *0        /usr/lib/jvm/java-7-oracle/jre/bin/java    1062       auto mode 
   1        /usr/lib/jvm/java-7-oracle/jre/bin/java    1062       manual mode

Press enter to keep the current choice[*], or type selection number:

Now copy the path from your preferred installation and then edit /etc/environment file by the command

sudo nano /etc/environment
This will open the environment file in nano editor, in the opened file add the following line
JAVA_HOME="/usr/lib/jvm/java-7-oracle

After adding this line, press ctrl+o and enter to save the file and ctrl+X to close the file. Finally we installed the Oracle JDK 7 in the Ubuntu Operating system.

Comments

Popular posts from this blog

How to fix Kindle wrong time left in chapter book

The most of kindle reader use the time left in chapter or time left in book options provided at left bottom of the page to estimate completing the book or the current chapter. But sometimes it was not  accurate and displaying 5 min left in chapter instead of 30 min left in chapter. To fix this issue just type ;ReadingTimeReset at search field and enter. Kindly refer the photo for the same.

Install Hadoop 2.5.1 on Windows 7 - 64Bit Operating System

This post is about installing Single Node Cluster Hadoop 2.5.1 (latest stable version) on Windows 7 Operating Systems.Hadoop was primarily designed for Linux platform. Hadoop supports for windows from its version 2.2, but we need prepare our platform binaries. Hadoop official website recommend Windows developers to use this build for development environment and not on production, since it is not completely tested success on Windows platform. This post describes the procedure for generating the Hadoop build for Windows platform. Generating Hadoop Build For Windows Platform Step 1:Install Microsoft Windows SDK 7.1 In my case, I have used Windows 7 64 bit Operating System. Download Microsoft Windows SDK 7.1 from Microsoft Official website and install it. While installing Windows SDK,I have faced problem like C++ 2010 Redistribution is already installed. This problem will happen only if we have installed C++ 2010 Redistribution of higher version compared to the Windows SDK. ...

Install Spring Tool Suite on Ubuntu

This post is about installing Spring Tool Suite (STS) on Ubuntu. The Spring Tool Suite is an Eclipse-based development environment that is customized for developing Spring applications. Step 1: Download the latest Spring Tool Suite for Linux from STS official website: http://spring.io/tools/sts/all  Step 2: Extract into any folder which you prefer. My extracted Spring Tool Suite locations is /home/harishshan/springsource Step 3: Create the Menu icon for quick access sudo nano /usr/share/applications/STS.desktop Step 4: Enter the following content [Desktop Entry] Name=SpringSource Tool Suite Comment=SpringSource Tool Suite Exec=/home/harishshan/springsource/sts-3.4.0-RELEASE/STS Icon=/home/harishshan/springsource/sts-3.4.0-RELEASE/icon.xpm StartupNotify=true Terminal=false Type=Application Categories=Development;IDE;Java; Step 5: Now you can check from Quick Menu by typing " Spring "