Hi Friends, In this video I represented, How to set JAVAHOME path in mac OS x or later version. From OS X 10.5, Apple introduced a command line tool (/usr/libexec/javahome) which dynamically finds the top Java version specified in Java Preferences for the current user. To set JAVAHOME path in Mac OSX or later, Please follow below stpes. Open terminal window 2.
Type command: $ vim /.bashprofile and Hit Enter 3. Type command: $ export JAVAHOME=$(/usr/libexec/javahome) and press Escape key for Save changes. Type command::(colon)wq, It will Save and close.bashprofile file. Type command: source /.bashprofile and hit Enter 6.
Now we can check the value of the JAVAHOME variable: 7. Type Command: echo $JAVAHOME The result should be the path to the JDK installation: /Library/Java/JavaVirtualMachines/jdk1.8.0111.jdk/Contents/Home Thanks for Watching this video Don't forget to Subscribe, Share, Like and comment. Facebook: YouTube: Twitter: GooglePlus: TAGS: - set javahome mac sierra set JAVAHOME JAVAHOME set JAVAHOME on mac set javahome mac set javahome mac permanently set javahome mac el capitan add javahome to path mac bin directory for $javahome is not set add '$javahome/bin' to your path environment.
Java package structure of Mac OS is a bit different from Windows. Don't be upset for this as a developer just needs to set PATH and JAVA_HOME. So in.bash_profile set JAVA_HOME and PATH as below.