Install Java Ubuntu
Here you will see how to install Java on your newly installed Ubuntu. First update the package index using below command:
sudo apt-get update
- Now check if java is already install or not using command:
java -version
- As you see above java is not installed yet so use below command to install JRE:
sudo apt-get install default-jre
- To check where it is installed use command “which java” or “type java” as below:
- To install JDK please use command “sudo apt-get install default-jdk”
- If you it installed successfully you will see below:
It was everything to install java. Below are other optional choice if you want to install:
- sudo apt-get install oracle-java8-installer — Install Oracle JDK 8
- sudo apt-get install oracle-java7-installer — Install Oracle JDK 7
- sudo apt-get install openjdk-7-jre — Install OpenJDK 7
- sudo apt-get install openjdk-7-jdk — Install Oracle JDK
- sudo apt-get install oracle-java6-installer — Install Oracle JDK 6
For more information please refer Unbuntu manual here