

Otherwise, if the output is empty or it differs from the actual JDK path, you should add the following line to the ~/.bashrc file: But make sure that it points to the JDK version 1.8.

If the output is not empty, it means that JAVA_HOME is set. Otherwise, if the output is empty or it differs from the actual JDK path, you should add the following line to the ~/.bash_profile file:Įxport JAVA_HOME=$(/usr/libexec/java_home) Compare it with the output from the execution following command in Terminal: But you should make sure that it points to the JDK version 1.8. To check the JAVA_HOME variable execute the following command in Terminal: It should display the installed version of Java in your system. Now to cross-check the installation, just run the following command in the cmd – java -version.

Now, you can click ‘OK’ and you are done. Under ‘Variable value’, at the end of the line, enter the following path – %JAVA_HOME%bin
