首页 > java, mac > MAC JAVA_HOME配置

MAC JAVA_HOME配置

2015年3月10日 1,139 views

1.which java(whereis java)
2.

$ ls -l /usr/bin/java  
lrwxr-xr-x  1 root  wheel  74 Jan  4 20:24 /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java

3.

$ ls -l /System/Library/Frameworks/JavaVM.framework/Versions
total 64
lrwxr-xr-x  1 root  wheel   10  5 11  2014 1.4 -> CurrentJDK
lrwxr-xr-x  1 root  wheel   10  5 11  2014 1.4.2 -> CurrentJDK
lrwxr-xr-x  1 root  wheel   10  5 11  2014 1.5 -> CurrentJDK
lrwxr-xr-x  1 root  wheel   10  5 11  2014 1.5.0 -> CurrentJDK
lrwxr-xr-x  1 root  wheel   10  5 11  2014 1.6 -> CurrentJDK
lrwxr-xr-x  1 root  wheel   10  5 11  2014 1.6.0 -> CurrentJDK
drwxr-xr-x  8 root  wheel  272  5 12  2014 A
lrwxr-xr-x  1 root  wheel    1  5 11  2014 Current -> A
lrwxr-xr-x  1 root  wheel   59  5 11  2014 CurrentJDK -> /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents

4.$ /usr/libexec/java_home
5.$ /usr/libexec/java_home -V
6.$ vim ~/.profile

JAVA_HOME=`/usr/libexec/java_home`
export JAVA_HOME
分类: java, mac 标签:
  1. 本文目前尚无任何评论.
  1. 本文目前尚无任何 trackbacks 和 pingbacks.