define a java_home variable
The first thing you need to do after installing the JDK is creating an environment variable named JAVA_HOME and then update the PATH variable. 1  JAVA_HOME: stores location of the JDKâs installation directory. When you install development tools, they will first check for the JAVA_HOME variable.