Search code examples
javagoogle-chrome-oschromium-os

What identifies the jdk installation directory?


I want to set my java_home variable, but have a custom enough OS not to be able to find my jdk dir as prompted everywhere (it's a chromium os, and has installed jdk8 by chromebrew...). What i have is a usr/local/jre folder, and few java* binaries in usr/local/bin.

Can the jre I have be the same that everyone refers to as /usr/java or /usr/java/jdk? The jre folder includes a bin, lib and plugin folder and some tl;dr files. Thanks a lot!


Solution

  • There is no "standard" definition for the JAVA_HOME, that is you can point it to the folder where either the JRE or the JDK is installed. The only requirement (which is in fact more of a generally accepted convention) is that $JAVA_HOME/bin/java should start the Java runtime.

    This happens if you point JAVA_HOME to either the JDK or JRE folder, in both cases there is a folder /bin and inside the "java" executable.

    In your case, since you identified the JRE installation folder, you can point JAVA_HOME to it.