On Mac OS X 10.5.8, after updating to Java 1.6.0_22 and installing the most recent developer update dated 20-Oct-2010, src.jar
for Java 6 is not present.
$ find /System/Library/Java /System/Library/Frameworks -name src.jar
/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/src.jar
/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/src.jar
Navigating to source in NetBeans 6.9.1 says compiled code
for all constructors and methods, e.g. java.awt.Point
:
public Point() {
//compiled code
throw new RuntimeException("Compiled Code");
}
It may be possible to extract a usable JAR from a previous update, as suggested in this thread.
Addendum: On NetBeans, the default platform's location is an attribute in the file ~/.netbeans/6.9/config/Services/Platforms/org-netbeans-api-java-Platform/default_platform.xml
:
<sources>
<resource>jar:file:/Library/Java/JavaVirtualMachines/
1.6.0_22-b04-307.jdk/Contents/Home/src.jar!/src/
</resource>
</sources>
Alternatively, the file /Library/Java/Home/src.jar
may be referenced:
<sources>
<resource>jar:file:/Library/Java/Home/src.jar!/src/</resource>
</sources>