p
For distributions based on Red Hat, use the yum package manager to install the java package.
[nvidia@localhost ~]$ sudo yum install java
For distributions based on Debian, use the apt package manager to install the default-jdk package.
[nvidia@localhost ~]$ sudo apt install default-jdk
Set the JAVA_HOME environment variable to the jre folder of your OpenJDK JRE installation, for example, /usr/lib/jvm/java-8-openjdk-amd64/jre.