If you are a bit into computers you must be knowing that java is must for several or I would say many important applications. By default jdk is not installed in your Linux distro (Ubuntu) , so to utilize the functionality of your system to its full extent we have to install it separately .
Oracle JAVA 8 is a stable release and available to download and install on official download page .Oracle Java PPA for Ubuntu is being maintained by Webupd8 Team and can be downloaded from there easily , which sets up everything for you on its own.Here is tutorial to install Oracle Java 7 and Oracle Java 8 on your distro.
How To Install Java On Ubuntu?
Basically we will have to install the packages and then run the installer .Java will be installed easily.Step 1: Add the PPA
We will have to download the required files(PPA) to the system .To add the PPA open the terminal(Ctrl+Alt+T) and run the following command :
This requires admin rights so we will have to use sudo.
For Oracle Java 7/8:
So enter the password after running this command and press Enter.
Press Enter again to allow it to add.
Step 2:Next we have to update the packages.
As now we have downloaded the files , we have to update.
Use the command :
Step 3:Final step is to run the installer.This installer installs the java in your system. On running it asks for some permissions which you will have to grant.Run the following command :
For Oracle Java 7:
For Oracle Java 8:
Next the screen will appear for license agreement , so press OK.
Next the screen will appear asking for whether to install or not .Choose YES and press Enter.
Now the Java is installed on your system.
To verify the installation , enter the command :
Step4: To configure Java default variables.
To automatically set up the Java 7 environment variables JAVA_HOME and PATH:
To automatically set up the Java 8 environment variables JAVA_HOME and PATH:
Enjoy the power of Java on your system. For any assistance or problem ask me in the comment box.