Reputation: 3183
I got a weird problem when I try to set java environment variables on my mac. Here is what I did:
nano ~/.bashrc
edit:
export JAVA_HOME=$(/usr/libexec/java_home)
export PATH=$JAVA_HOME/bin:$PATH
save then
source ~/.bashrc
check
echo $JAVA_HOME
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
So far everything is good. But my problem is that when I reboot, echo $JAVA_HOME shows nothing. After typing source ~/.bashrc again, echo $JAVA_HOME shows the correct result which means I need to type source ~/.bashrc every time when I reboot mac.
Upvotes: 0
Views: 494