JDK on OSX 10.7 Lion

后端 未结 5 757
醉话见心
醉话见心 2020-12-02 05:17

I\'ve instaled the Java for Developer package provided from Apple for 10.7 and java apps are running fine

but eclipse cannot find the JDK root path and I cant either

相关标签:
5条回答
  • 2020-12-02 05:40

    For Mountain Lion, Apple's java is up to 1.6.0_35-b10-428.jdk as of today.
    It is indeed located under /Library/Java/JavaVirtualMachines .

    You just download
    "Java for OS X 2012-005 Developer Package" (Sept 6, 2012)
    from
    http://connect.apple.com/

    In my view, Apple's naming is at least a bit confusing; why "-005" - is this the fifth version, or the fifth of five installers one needs?

    And then run the installer; then follow the above steps inside Eclipse.

    0 讨论(0)
  • 2020-12-02 05:43

    On newer versions of OS X you should find ALL JREs (and JDKs) under

    /Library/Java/JavaVirtualMachines/

    /System/Library/Java/JavaVirtualMachines/

    the old path

    /System/Library/Frameworks/JavaVM.framework/

    has been deprecated.

    Here is the official deprecation note:

    http://developer.apple.com/library/mac/#releasenotes/Java/JavaSnowLeopardUpdate3LeopardUpdate8RN/NewandNoteworthy/NewandNoteworthy.html#//apple_ref/doc/uid/TP40010380-CH4-SW1

    0 讨论(0)
  • 2020-12-02 06:00

    You can download the 10.7 Lion JDK from http://connect.apple.com.

    1. Sign in and click the java section on the right.

    2. The jdk is installed into a different location then previous. This will result in IDEs (such as Eclipse) being unable to locate source code and javadocs.

    3. At the time of writing the JDK ended up here:

      /Library/Java/JavaVirtualMachines/1.6.0_26-b03-383.jdk/Contents/Home

    4. Open up eclipse preferences and go to Java --> Installed JREs page

    5. Rather than use the "JVM Contents (MacOS X Default) we will need to use the JDK location

    6. At the time of writing Search is not aware of the new JDK location; we we will need to click on the Add button

    7. From the Add JRE wizard choose "MacOS X VM" for the JRE Type

    8. For the JRE Definition Page we need to fill in the following:

      • JRE Home: /Library/Java/JavaVirtualMachines/1.6.0_26-b03-383.jdk/Contents/Home
    9. The other fields will now auto fill, with the default JRE name being "Home". You can quickly correct this to something more meaningful:

      • JRE name: System JDK
    10. Finish the wizard and return to the Installed JREs page

    11. Choose "System JDK" from the list

    12. You can now develop normally with:

      • javadocs correctly shown for base classes
      • source code correctly shown when debugging
    0 讨论(0)
  • 2020-12-02 06:00

    I have just ran into the same problem after updating. The JRE that is downloaded by OSX Lion is missing JavaRuntimeSupport.jar which will work but can wreck havoc on a lot of things. If you've updated, and you had a working JDK/JRE installed prior to that, do the following in Eclipse:

    1) Project > Properties > Java Build Path > Select broken JRE/JDK > Edit

    2) Select "Alternate JRE"

    3) Click "Installed JREs..."

    4) In the window that opens, click "Search..."

    If all goes well, it will find your older JRE/JDK. Mine was in this location:

    /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home
    
    0 讨论(0)
  • 2020-12-02 06:00

    You can download jdk6 here http://support.apple.com/kb/DL1573

    Wish it helps

    0 讨论(0)
提交回复
热议问题