Set JAVA_HOME in Mac

I just moved over to Mac (again) and the first thing when started Java Programming was how to get Java_Home in place. While Mac makes a lot of things easy, programming is where it takes you all back to the root. After much finding and reading I found that the following worked.


1. Start the Terminal application

2. Create or Edit a file with the name.location “~/.bash_profile file”. Do    $ vi ~/.bash_profile

3. Put the following line in the file (if it is broken down to  2 lines put it in a single line)

export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home

4. Save the file.

5. Restart the Terminal and then try $ echo $JAVA_HOME


And you are all set

3 thoughts on “Set JAVA_HOME in Mac

Initiate your idea here...

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s