Java is the widely used programming language used by billion of application worldwide. Generally, every system required Java installed there. JDK provides the Java compiler required for Java development and JRE provides runtime environment only. The users want to create java programmes and run them on their machines required to install JDK and JRE both. If you have compiled version of Java programs and just need to run them, use JRE only. This tutorial will install JDK and JRE both on your Ubuntu systems. In this tutorial you will require the PPA maintained by Webupd8 Team to Install Java 8 on Your Ubuntu and LinuxMint system.
Use this tutorial for installing Oracle Java 8 on Ubuntu 17.10, 16.04, 14.04 and 12.04 LTS and LinuxMint 18, 17 systems using PPA.
Step 1 – Install JAVA 8
First of all, you need to add webupd8team Java PPA repository in your system. After that install, Oracle Java 8 using following a set of commands. The oracle-java8-installer package is not the actual Java package, it has a Java installation script which downloads Java archive from official java website and configures on your system.
sudo add-apt-repositoryppa:webupd8team/java sudo apt-getupdate sudo apt-getinstall oracle-java8-installer
Step 2 – Verify Installed Java Version
After successfully installing Oracle Java 8 using the above steps, Let’s verify the installed version using the following command.
java -versionjava version " 1.8.0_161" Java(TM) SE Runtime Environment (build 1.8.0_161-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)
Step 3 – Setup Java Environment
Also, install Java configuration package. It seems like below package is already installed with latest operating systems during installation of JAVA packages. But you can still make sure by running below command.
sudo apt-get installoracle-java8-set-default
Now add the JAVA_HOME and JRE_HOME environment variable in /etc/environment configuration file using the following command.
cat >> /etc/environment <<EOL JAVA_HOME=/usr/lib/jvm/java-8-oracle JRE_HOME=/usr/lib/jvm/java-8-oracle/jre EOL
Finally, You have successfully installed Java 8 on your system. In addition if you are looking for Google chrome installation visit Install Google Chrome on Ubuntu & LinuxMint