I recently bought a new macbook pro
This is my first mac ever and i'm still trying to learn the ropes
I'm also new to java and i've been practicing on my windows pc before it died permanently
Now that I'm on this MAC, I installed my JDK and now I need to set the
JAVA_HOME environment variable.
I have no idea what to do
I tried following a few of these guides and did not go much farther
I'm able to find the terminal and i'm sure i created multiple files I've received messages like that
(1) Another program may be editing the same file. If this is the case, be careful not to end up with two different instances of the same file when making changes. Quit, or continue with caution.
(2) An edit session for this file crashed. If this is the case, use ":recover" or "vim -r /Users/Erwin/.bash_profile" to recover the changes (see ":help recovery"). If you did this already, delete the swap file "/Users/Erwin/.bash_profile.sw p" to avoid this message.
Tell me the easiest way to set java in the mac os x environment?
Just what you have to do
echo export "JAVA_HOME=\$(/usr/libexec/java_home)" >> ~/.bash_profile
and restart your shell.
If you have multiple JDK versions installed and you want it to be a specific one, you can use the
-v flag to
java_home like so.
echo export "JAVA_HOME=\$(/usr/libexec/java_home -v 1.7)" >> ~/.bash_profile