Java for Mac OS X 10.6 Update 3 upgraded to java 1.6.0_22. However, they did not include the source code or JavaDoc. Does anyone know if Apple provides the source, and if so, where to find it?
I'd like to attach the source to Eclipse.
The cleanest way to manage multiple java versions on Mac is to use Homebrew . And within Homebrew , use: homebrew-cask to install the versions of java. jenv to manage the installed versions of java.
In macOS, the JDK installation path is /Library/Java/JavaVirtualMachines/jdk-10. jdk/Contents/Home . The root directory of the JDK software installation.
Switch Java JDK via alias Setup your JAVA_HOME path in your . zshrc or . bash_profile for your primary Java version and add an export for each installed Java version. Add an alias to your .
I had the same problem today - I installed the Java Developer package from http://connect.apple.com, but couldn't find "src.jar" in /System/Library/Frameworks/JavaVM.framework/...
anymore. On my machine, it's now in/Library/Java/JavaVirtualMachines/1.6.0_22-b04-307.jdk/Contents/Home/src.jar
.
Update: For the latest version from March 2011, the jar is now:/Library/Java/JavaVirtualMachines/1.6.0_24-b07-334.jdk/Contents/Home/src.jar
Once again, you'll have to download the new Java Developer package first.
What I do is as follows:
Download and install the Java Developer Kit (using your developer AppleId), current version 1.6.0_24-b07-334.jdk
, and then in a shell, cd to the /System/Library/Frameworks/JavaVM.framework/Home
directory.
Put in symbolic links to the jdk source files, src.jar
, docs.jar
and appledocs.jar
, in the jdk you've just downloaded, that is:
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 jars.
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 the original.
The Eclipse Projects might need updating to point to the 'new' JRE, but the source and javadocs should now be available for the standard java stuff without further ado.
NB Ensure that the version of the jdk matches the version of your system Java for this to work properly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With