How to set JAVA_HOME in Mac OS X High Sierra

This post describes how to configure the JAVA_HOME environment variable required by many enterprise tools, frameworks, and CMSes. For instance, Liferay, Tomcat, etc. will use this variable to work properly. In case you have changed your default shell (Bash) that comes with OS X out-of-the-box, please read How to set JAVA_HOME in Mac OS X High…