I do the following:
Download and install the Java Developer Kit (using your AppleId developer), the current version 1.6.0_24-b07-334.jdk , and then into the cd shell in the /System/Library/Frameworks/JavaVM.framework/Home directory.
Put symbolic links to the jdk, src.jar , docs.jar and appledocs.jar source files in the jdk you just downloaded, i.e.:
sudo ln -s /Library/Java/JavaVirtualMachines/1.6.0_24-b07-334.jdk/Contents/Home/src.jar src.jar
and similarly for the other two cans.
Then in Eclipse / Preferences you can create a new Installed JRE by duplicating the existing one (the existing one points to something like /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home ) and then select the new Installed JRE and remove original.
Eclipse projects may need to be updated to point to the βnewβ JRE, but the source code and javadocs should now be available for standard java files without too much noise.
NB Make sure that the jdk version matches the version of your Java system so that it works correctly.
Steve Powell Apr 05 2018-11-11T00: 00Z
source share