MAC设置$JAVA_HOME

MAC设置$JAVA_HOME

查看java信息:

$ which java
/usr/bin/java

$ ls -l /usr/bin/java
lrwxr-xr-x  1 root  wheel  74 10 21  2015 /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java

查看当前使用的版本:

$ java -version

java version "1.8.0_45"

Java(TM) SE Runtime Environment (build 1.8.0_45-b14)

Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

设置JAVA_HONE:

   

$ cat ~/.profile  
JAVA_HOME=`/usr/libexec/java_home`  
export JAVA_HOME

mac

相关推荐