

This should return the path to the Java binary. Verify the variable was set correctly: echo $JAVA_HOME Reload your system’s environment variables: source /etc/environment To set the variable for your system: echo "JAVA_HOME=$(which java)" | sudo tee -a /etc/environment This variable points them to the Java binary file, allowing them to run Java code. Many applications include code or configuration that references the JAVA_HOME environment variable. Note that this is unnecessary if you’ve installed OpenJDK, since it includes the JRE. However, if you only need to run applications that you’ve already downloaded, you can save a bit of disk space by installing the OpenJRE (Java runtime environment): sudo apt-get install openjdk-8-jre OpenJDK 64-Bit Server VM (build 25.212-b03, mixed mode) Verify that Java and the Java compiler have been properly installed: java -versionĪs of this publication, these commands should return the following: java version "1.8.0_212" This package will run an installer for The OpenJDK 8, which is the latest LTS version available for Ubuntu 16.04 release. Install OpenJDK 8: sudo apt-get install openjdk-8-jdk Install the “Main” repository with apt: sudo apt-get update This “Main” repository is maintained by Canonical, the company that maintains Ubuntu.
