This article may be suitable for those who often develop Java programming on Mac or use Java tools frequently. If you do not care about Java or do not know Java, you can bypass this article ~
1. In Mac, when you enter Java-version on the [terminal], where is the Java executed? The which Java command can be seen as [/usr/bin/Java]
2. [/usr/bin/Java] is just a replacement, actually pointing to [/system/library/frameworks/JavaVM. framework/versions/current/commands/Java], LS-l Java, you can see
3. [/system/library/frameworks/JavaVM. framework/versions/current/commands/Java is not really Java, because the current folder is a replacement, it points to a version in the same directory, such as a folder, for example: (the advantage is that after multiple versions of Java are installed, you can easily adjust the current direction so that different versions of Java become the system's default, this can be adjusted in [utility]> [Java preference settings)
4. The a folder mentioned in point 3rd is generated by the system after Java is installed. The commands folder contains a Java executable file, this Java actually calls the genuine Java itself-> [/library/Java/javavirtualmachines/1.6.0 _ 37-b06-434.jdk/contents/home/bin/Java] (you can try to change this Java names, enter Java in the terminal to understand)
PS: the version number (1.6.0 _ 37-b06-434) may be different from each other, or multiple versions may exist. It depends on the number of Java versions installed on your machine.
5. In the final analysis, [/library/Java/javavirtualmachines/1.6.0 _ 37-b06-434.jdk/contents/home/bin/Java] is the real worker. Hey, let's get around.
Remarks: This article Reprinted from: http://www.mactech.cn/a/234.html