Are you searching for a tutorial on how to install java in Ubuntu? Here is a comprehensive tutorial on how to install Java or JDK on Ubuntu.
Today , Java installation is a basic requirement for a lot of programs running in our system. This lecture will guide you through the steps of how to install java or jdk in Ubuntu.
First of all you need to have a basic knowledge about the JRE, JDK and OpenJDK. JRE (Java Runtime Environment) is needed to run the java program. JDK stands for Java Development Kit, is used for development and reading of java programs. OpenJDK is open source JDK from sun Microsystems.
How to install Java or jdk in Ubuntu
How to install JDK
You might know how to open a new terminal window in your system either press Ctrl+Alt+T on your keyboard or directly search the terminal in the search window in your system. When the terminal window is open type the following command in the terminal window and hit enter. Your system will ask you to input your system password to proceed the installation.
Apt-get package is an easy way to install java. First you need to update the package.
sudo apt-get update
Before you start installing java, you can check whether your system has already java installed or not. You can use the below command to check the java version in your system.
java –version
When you run the above command shows you either the version of java you have installed in your system or java is not installed as shown below.
If it returns “java package is not found in your system” type the following command in your terminal window. As you all know Java Development Kit (JDK) is necessary for compiling your java programs. Since JDK contains Java Runtime Environment (JRE) , you don’t need to separately install JRE in your system. Execute the following command in your terminal window.
sudo apt-get install default-jdk
Oracle JDK
The official JDK is oracle JDK. To install different versions of oracle JDK, execute the following command based on our need.
sudo apt-get install oracle-java8-installer
sudo apt-get install oracle-java7-installer
sudo apt-get install oracle-java6-installer
For more reference visit the following links: Link1 or Link2
2 Replies to “How to install Java or JDK in Ubuntu”