Note: This tip is for Mac OSX 10.5 or later
Apple recommends to set the $JAVA_HOME variable to /usr/libexec/java_home, just export $JAVA_HOME in file ~/. bash_profile
You might not have .bash_profile present on your system already. No worries we will create/update the profile in next step.
Open Terminal:
$ vi ~/.bash_profile
Initially the vi editor will not be in edit mode, press 'i'.
Update file by exporting variable:
Apple recommends to set the $JAVA_HOME variable to /usr/libexec/java_home, just export $JAVA_HOME in file ~/. bash_profile
You might not have .bash_profile present on your system already. No worries we will create/update the profile in next step.
Open Terminal:
$ vi ~/.bash_profile
Initially the vi editor will not be in edit mode, press 'i'.
Update file by exporting variable:
export JAVA_HOME=$(/usr/libexec/java_home)
to the file (in the vi editor which we opened using the previous command)
Saving and Closing the .bash_profile file opened inside vim editor:
Press escape (while still inside the vi editor)
type ":wq!" or press "Shift + zz" to save and exit the file.
Comments
Post a Comment