Results 1 to 3 of 3
  1. #1
    user0 is offline Senior Member
    Join Date
    Dec 2010
    Posts
    100
    Rep Power
    0

    Default How to Lookup Code for Java API Classes

    Hi all - would anyone know how I could look up the code for an actual java class? For example, if I want to find out how OutputStream class is implemented, is there a quick way to look up the underlying code? I am using Eclipse IDE Helios.

    Thanks in advance!
    --user0--

  2. #2
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    5

    Default

    there used to be a sources.zip file that came with a JDK, or possibly it is still available as a separate download Java Platform, Standard Edition 6u23 Source Snapshot Releases

    once you have this, use eclipse to link the source to the jar files in the jre in the workspace. this should be under the settings menu,
    java > installed jre,
    select edit.
    there is a meatloaf of jar files in the jre classpath, usually i just select the first classes.jar and click source attachment, specify my jar / zip file of the sources.

  3. #3
    user0 is offline Senior Member
    Join Date
    Dec 2010
    Posts
    100
    Rep Power
    0

    Default

    Hi Travis - I looked around for the zip file but could not find it. I was able to download the the OpenJDK source bundles form java.net and I attached a link to the source files in Eclipse just like you said. Works beautifully.

    Thanks for your help!
    --user0--

Similar Threads

  1. Source code of Predefined classes and methods
    By lobodelbosque in forum New To Java
    Replies: 8
    Last Post: 08-10-2011, 02:11 PM
  2. Problem to organize my code in classes
    By ze snow in forum New To Java
    Replies: 4
    Last Post: 02-23-2010, 04:28 AM
  3. How to divide code in classes?
    By hendrix79 in forum New To Java
    Replies: 2
    Last Post: 12-10-2008, 05:36 PM
  4. [SOLVED] Using Code Throughout 5 Classes-Stuck
    By Bascotie in forum New To Java
    Replies: 46
    Last Post: 06-06-2008, 05:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •