

Reload the file so all your changes could take effect with the following command: source /etc/profile Now that you are in the user profile file, add the following code, along with the Path of your installation from the previous step, to the bottom. With the following command, you can view your installs and their path: sudo update-alternatives -config java We will need to find the appropriate path to make these changes. Since many programs now days need a JAVA_HOME environment variable to work properly. Java HotSpot(TM) 64-Bit Server VM (build 25.74-b02, mixed mode) Java(TM) SE Runtime Environment (build 1.8.0_74-b02) Sudo apt-get install oracle-java8-installer Then, you will need to fully update the system with the following command and install it: sudo apt-get update Sudo add-apt-repository ppa:webupd8team/java However, we would need to install additional repositories for a proper installation: sudo apt-get install python-software-properties Once you have verified if Java is installed or not, choose the type of Java installation that you want with one the following: sudo apt-get install openjdk-7-jreĪnother alternative Java install is with Oracle JRE and JDK. If there is no java package installed ye, output will be something like: The program 'java' can be found in the following packages: sudo apt-get updateĪfter your server has been fully updated, verify if java is installed or not: java -version First make sure that all your system packages are up-to-date by running these following apt-get commands in the terminal. Install Java (JRE or JDK) on Ubuntu 16.04 I will show you through the step by step installation JRE (Java Runtime Environment) and JDK (Java Development Kit) on Ubuntu 16.04. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. Many programs and scripts that require java to run it, but usually Java is not installed by default on VPS or Dedicated Server. In this tutorial we will show you how to install and configuration of java JRE or JDK on your Ubuntu 16.04 server.
