JAVA_HOME环境变量对java开发很重要,mac下也不例外。
mac自带jdk,apple维护的jdk,默认的jdk路径,也就是JAVA_HOME路径是:
/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
java version “1.6.0_22″
Java(TM) SE Runtime Environment (build 1.6.0_22-b04-307-10M3261)
Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03-307, mixed mode)
openjdk7有mac的版本,装好后,路径是:
/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home
openjdk version “1.7.0-internal”
OpenJDK Runtime Environment (build 1.7.0-internal-b00)
OpenJDK 64-Bit Server VM (build 20.0-b06, mixed mode)
openjdk6也可以运行在mac下,不过不能直接运行,需要有macport。
都安装好后,openjdk6的路径是:
/opt/local/share/java/openjdk6
openjdk version “1.6.0″
OpenJDK Runtime Environment (build 1.6.0-b20)
OpenJDK 64-Bit Server VM (build 17.0-b16, mixed mode)