Results 1 to 12 of 12
  1. #1
    davetheant is offline Member
    Join Date
    Sep 2010
    Posts
    47
    Rep Power
    0

    Default Inside Java's API

    Hello everyone. I am wondering if there is any way to look inside the API (and actually see what those methods are made up of). Someone had to have written those methods, and I would like more insight as to what they contain. Thanks in advance.

  2. #2
    demonick is offline Member
    Join Date
    Dec 2010
    Posts
    27
    Rep Power
    0

    Default

    In your Java - > jdk folder there must be a archived file named "src", unzip and have fun.

  3. #3
    davetheant is offline Member
    Join Date
    Sep 2010
    Posts
    47
    Rep Power
    0

    Default

    Thanks for the response. I went to Java --> jdk --> but I don't see an 'src'. Is it in another folder? When I ran a search for 'src', I saw maybe 20 folders with the same name.

  4. #4
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,574
    Rep Power
    12

    Default

    The name of the file is src.zip

  5. #5
    davetheant is offline Member
    Join Date
    Sep 2010
    Posts
    47
    Rep Power
    0

    Default

    The only file I see on my entire hard drive is called swing-layout-1.0.4-src.zip, and inside are 6 java files. They dont seem to be related to the API at all.

  6. #6
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,574
    Rep Power
    12

    Default

    Have you installed the JDK? If so, to which directory?

  7. #7
    davetheant is offline Member
    Join Date
    Sep 2010
    Posts
    47
    Rep Power
    0

    Default

    Well I'm coding, so I must have the jdk, right?
    C:\Program Files\Java\jdk1.6.0_21

  8. #8
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,574
    Rep Power
    12

    Default

    Good. Copy and paste the results of

    Java Code:
    >dir "C:\Program Files\Java\jdk1.6.0_21"

  9. #9
    davetheant is offline Member
    Join Date
    Sep 2010
    Posts
    47
    Rep Power
    0

    Default

    Microsoft Windows [Version 6.0.6002]
    Copyright (c) 2006 Microsoft Corporation. All rights reserved.

    C:\Users\username>dir "C:\Program Files\Java\jdk1.6.0_21"
    Volume in drive C is OS
    Volume Serial Number is ****-****

    Directory of C:\Program Files\Java\jdk1.6.0_21

    10/31/2010 09:04 PM <DIR> .
    10/31/2010 09:04 PM <DIR> ..
    10/31/2010 09:03 PM <DIR> bin
    07/17/2010 05:32 AM 3,409 COPYRIGHT
    10/31/2010 09:04 PM <DIR> demo
    10/31/2010 09:03 PM <DIR> include
    10/31/2010 09:03 PM <DIR> jre
    10/31/2010 09:03 PM <DIR> lib
    10/31/2010 09:03 PM 28,942 README.html
    10/31/2010 09:03 PM 25,759 README_ja.html
    10/31/2010 09:03 PM 21,170 README_zh_CN.html
    10/31/2010 09:04 PM 5,351 register.html
    10/31/2010 09:04 PM 6,885 register_ja.html
    10/31/2010 09:04 PM 4,936 register_zh_CN.html
    10/31/2010 09:04 PM <DIR> sample
    10/31/2010 09:03 PM 186,655 THIRDPARTYLICENSEREADME.txt
    8 File(s) 283,107 bytes
    8 Dir(s) 656,011,264 bytes free

    C:\Users\username>

  10. #10
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,574
    Rep Power
    12

    Default

    Umm... That's where it usually lives. (And some applications use it so you can step into code when debugging, get javadoc etc).

    In fact the source for the entire JDK is available. I'm just checking what it contains - I'll post again in a few minutes.

  11. #11
    davetheant is offline Member
    Join Date
    Sep 2010
    Posts
    47
    Rep Power
    0

    Default

    Maybe I'm missing something, but I don't see where the methods are actually broken down.

  12. #12
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,574
    Rep Power
    12

    Default

    Quote Originally Posted by davetheant View Post
    Maybe I'm missing something, but I don't see where the methods are actually broken down.

    The classes you are linking with and using are in jre\lib\rt.jar, but there's no source code there only compiled byte code.

    -----------------------

    As I see it you have a couple of options: (A) reinstall the JDK. 1.6.0_20 certainly had src.zip and I don't imagine _21 is any different.

    or (B) download http://www.java.net/download/jdk6/6u...2_nov_2010.jar which contains the source for the entire JDK. You run this jar file, accept the license and put the files wherever you like - a newly created directory somewhere convenient. It has all sorts of stuff, but the Java library code is in j2se\src\share\classes

Similar Threads

  1. Where do I find java's standard library?
    By Arnold in forum New To Java
    Replies: 8
    Last Post: 10-13-2009, 09:59 AM
  2. Replies: 2
    Last Post: 01-29-2009, 08:17 PM
  3. Java's web world is really difficult..
    By jurka in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 09-02-2008, 06:33 PM
  4. n00b: confused about java's RIA/Rich Client Story
    By bryancostanich in forum New To Java
    Replies: 2
    Last Post: 05-02-2008, 02:16 AM
  5. Replies: 0
    Last Post: 04-07-2008, 08:56 PM

Posting Permissions

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