Installing the JDK on your Mac
Download for 1.JDK
If you want to install JDK7 or JDK8 can go directly to the official website to download, to install JDK6, go to the Apple Developer's website downloaded
Download URL: http://connect.apple.com/
2. Default installation path
JRE Path:/system/library/frameworks/javavm.framework/
JDK Path:/library/java/javavirtualmachines/
Path to Java_home:/library/java/javavirtualmachines/1.6.0/contents/home
Note: The 1.6.0 directory name is related to the installed JDK version, using your own actual path,
There are also other versions of the JDK under/system/library/frameworks/javavm.framework/versions/
You can configure it, use a different version, and notice that there are several soft links on the line.
3. About Rt.jar, Jsse.jar, Tools.jar
In the classes under the/system/library/java/javavirtualmachines/1.6.0.jdk/contents
Rt.jar and Tools.jar are integrated into Classes.jar, so you're going to link them to/system/library/java/javavirtualmachines/1.6.0.jdk/contents/home/ Lib in
Jsse.jar do likewise to the processing.
4. Configure Environment variables
Java_home=/system/library/frameworks/javavm.framework/versions/1.6.0/home
Path= $PATH: $JAVA _home/bin
Classpath=.: $JAVA _home/lib/tools.jar: $JAVA _home/lib/dt.jar: $JAVA _home/lib/rt.jar
Export PATH java_home CLASSPATH
Execute source/etc/profile to make the configuration file effective
Description: This article refers to: http://kennylee26.iteye.com/blog/1772638
Build a Java development environment on your Mac