Mac Os Update Java

Feb 14, 2019 - Learn step-by-step tutorial how to update Oracle JDK (Java) on Mac OS in 2019.

This question already has an answer here:

  • Java/Eclipse on MacOSX: where is the src.zip? 12 answers

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.

curthipstercurthipster

marked as duplicate by Brent Worden, Janne Karila, Stephan, Ragunath Jawahar, david99worldMar 18 '13 at 14:17

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

11 Answers

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 nowin
/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.

Chris LercherChris Lercher

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.

Steve PowellSteve Powell

Install java source, docs in 8 steps:

  1. Sign in with your Apple ID (http://connect.apple.com)

  2. Go to https://developer.apple.com/downloads/index.action

    • Applicable models: Canon MF4750, MF4730, MF4770n and others MF47XX printers. Canon mf4700 series software download full. • Software: Scanner and printer drivers.

  3. Download Java for OS X 2012-00* Developer Package

  4. Install javadeveloper_for_os_x_ * .dmg.

  5. Go to Eclipse > Preferences > Java > Installed JRE

  6. Click Search..

  7. Choose JRE with location like /Library/Java/JavaVirtualMachines/1.6.0_your_jdk_filename.jdk/contents/home. In my case jdk file name was 1.6.0_33-b03-424.jdk.

    You can find the file name of jdk in terminal: ls -l /Library/Java/JavaVirtualMachines

  8. Now, when you try 'open declaration' and get message 'Source Not Found' press button Attach source.. and paste /Library/Java/JavaVirtualMachines/1.6.0_your_jdk_filename.jdk/contents/home/src.jar

Alexander FedorovAlexander Fedorov

These are the exact steps that worked for me.

Go to the apple dev java downloads page and get the latest one you can (the apple dev web site will not let you download packages that are unsuitable for your OS version).
I installed Java Developer Package for Mac OS X 10.6 Update 5 (Disk Image).

Then I executed these commands:

Then I restarted Eclipse (I didn't have to create a new JRE).

BohemianBohemian

You may also need to install the Java Developer Update: http://developer.apple.com/library/mac/releasenotes/Java/JavaSnowLeopardUpdate3LeopardUpdate8RN/NewandNoteworthy/NewandNoteworthy.html

Adam VandenbergAdam Vandenberg

Found it also not working after download and installation. Using the directory didn't work either for me. This helped finally:

and the linked it through eclipse!

oaeoae

I found that the solutions were not working for me (not sure what I am doing wrong), but I was able to see the source in Eclipse when I selected the directory of src.jar instead of specifying the actual jar.

lindon foxlindon fox

FYI; On a Macbook Pro 2008, however reinstalled from scratch with Lion and NetBeans 7.0.1, thus the package Java 10.7 update 1 (the latest release), the source and JavaDoc were luckily auto installed after downloading the developer package as described in this thread. All is well.

carlcarl

For OSX 10.7 Lion running Java update 1, I found the sources to be in: /Library/Java/JavaVirtualMachines/1.6.0_29-b11-402.jdk/Contents/Home/src.jar. As noted in the other answers, you will first need to download and install the Java Developer package from Apple before setting this directory in your IDE.

pm_labspm_labs

On 31-Jan-2012, Apple posted the Java for Mac OS X Developer Preview 11M3614+10M3614 on their developer site.

This is a version that includes source code, doc, etc. (i.e., everything a developer needs).

jadcjadc

Download ubuntu package from the following link, extract it (usr ar command i.e. ar -x *.deb),

copy src.zip file and save it.

Sumit KapoorSumit Kapoor

Not the answer you're looking for? Browse other questions tagged javamacos or ask your own question.

-->

This article illustrates how to update the Java Development Kit (JDK) version on Windows and Mac.

Overview

Xamarin.Android uses the Java Development Kit (JDK) to integrate withthe Android SDK for building Android apps and running the Androiddesigner. The latest versions of the Android SDK (API 24 and higher)require JDK 8 (1.8). Alternately, you can install theMicrosoft Mobile OpenJDK Preview.The Microsoft Mobile OpenJDK will eventually replace JDK 8 for Xamarin.Androiddevelopment.

To update to the Microsoft Mobile OpenJDK, seeMicrosoft Mobile OpenJDK Preview.To update to JDK 8, follow these steps:

  1. Download JDK 8 (1.8) from the Oracle website:

  2. Pick the 64-bit version to allow rendering ofcustom controlsin the Xamarin Android designer:

  3. Run the .exe and install the Development Tools:

  4. Open Visual Studio and update the Java Development Kit Locationto point to the new JDK under Tools > Options > Xamarin > AndroidSettings > Java Development Kit Location:

Be sure to restart Visual Studio after updating the location.

  1. Download JDK 8 (1.8) from the Oracle website:

  2. Open the .dmg file and run the .pkg installer:

Mac

Mac OS will automatically set the new JDK version as the default byupdating /System/Library/Frameworks/JavaVM.framework/Versions/Current.You can then double-check that the Java SDK (JDK) location is set tothe expected default of /usr under Visual Studio for Mac > Preferences >Projects > SDK Locations > Android > Locations > Java SDK (JDK) Location: