Java - Install

Updated: 2020-12-29

Install Prebuilt OpenJDK

Download OpenJDK from http://jdk.java.net/

Extract the package:

$ tar xvzf openjdk-<version>_bin.tar.gz

Add this to ~/.bash_profile or ~/.bashrc:

export JAVA_HOME=/path/to/jdk-<version>

PATH=$JAVA_HOME/bin:$PATH

Then "source" it:

$ . ~/.bashrc

Verify that Java is correctly installed:

$ java -version

Install Prebuilt Oracle JDK

Oracle JDK from: http://www.oracle.com/technetwork/java/javase/downloads/index.html

If you are using .tar.gz, it would be similar to OpenJDK. If you are installing .dmg on macOS, JDK should be installed in this folder:

/Library/Java/JavaVirtualMachines/jdk<version>.jdk/Contents/Home