Menu

Plug-in for JDK under Mac OS X?

2009-09-09
2013-04-30
  • Yáng  Guǐzi  洋鬼子

    Just a few days ago, I downloaded and installed EasyEclipse Desktop Java version 1.3.1.1 for Mac OS X.  Now I'm trying to teach myself how to work with the incredibly complex Eclipse IDE.

    Of course, I'd like to be able to consult the Java API from within Eclipse.  The book Eclipse for Dummies © 2005 says on pages 93 to 96 that I *can* see the Java API javadocs within the Javadocs view, and see the Java API source within the Declaration view -- but *only if*, in the Package Explorer, the JRE System Library branch contains an rt.jar branch.  In my Eclipse, this rt.jar branch is absent.  The rt.jar branch supposedly contains the standard Java runtime library.

    I note that the composition of EasyEclipse Desktop Java includes a plug-in for the JDK under Windows and under Linux, but not under Mac OS X.  I wonder if the absence of the rt.jar branch has anything to do with the lack of a JDK plug-in for Mac OS X?  (The composition of EasyEclipse Desktop Java is shown at URL www.easyeclipse.org/site/distributions/desktop-java.html .)  I imagine the reason this plug-in was not included for OS X is because OS X comes with the JDK already installed.

    Is there some plug-in that I can download either from the EasyEclipse project or from some Eclipse Webpage that will add the rt.jar branch to the JRE System Library branch in Package Explorer?

    Thanks, 洋鬼子 (Yang2 Gui3zi)

    My config is:
    Mac OS X 10.6.0 Snow Leopard
    MacBook Pro, with Intel Core 2 Duo @ 2.33 GHz
    3 Gb ram memory

     
  • Yáng  Guǐzi  洋鬼子

    I found my own answer, because no answer was posted on this forum.  In the hope that it will save some other Eclipse newbie from hours of searching with Google, here is the answer.

    Java under OS X does **not** have an rt.jar.  The classes that would be in rt.jar are split between classes.jar and ui.jar.

    To show source code for the Java API in two Eclipse views - Declaration View and Javadoc View - follow these instructions:

    1. Open the Package Explorer.
    2. Open the JRE System Library branch in any package that has one.  The same changes will be made to all JRE System Library branches.
    3. Right-click on the classes.jar branch.
    4. Select Properties from the context menu.
    5. In the left pane of the Properties window, select Java Source Attachment.
    6. In the right pane, in the Location Path field, you should already have the location of the Java source files.  If not, it is similar to this:
         /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/src.jar
    Use Finder to locate the src.jar for your installation of Java.  Then enter its pathname in the Location Path field.
    7. Click Apply and OK.
    8. Now do steps 3 through 7 for the ui.jar branch.

    Thereafter, when you click, in an editor, on any Sun Java identifier, info about it should display in the Javadoc and Declaration Views.

     

Log in to post a comment.