Results 1 to 11 of 11
  1. #1
    dewitrydan is offline Member
    Join Date
    Aug 2010
    Posts
    67
    Rep Power
    0

    Default java eclipse source

    hey there
    I want to view the source for a few classes in java.
    But when I try and view the source, eclipse gives me "source not found"
    can you help me please?
    thanks

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

  3. #3
    dewitrydan is offline Member
    Join Date
    Aug 2010
    Posts
    67
    Rep Power
    0

    Default

    yeah, it comes up when I try to look at the source for a certain class e.g. Thread.class

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by dewitrydan View Post
    yeah, it comes up when I try to look at the source for a certain class e.g. Thread.class
    And the reason for that is precisely as I thought -- the source for this is not available in this way. You'll have to check your JDK install and look for a zip file that has the source for this. I think it's called src.zip or something similar.

  5. #5
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    Where were you looking? It should be located somewhere like this
    Java Code:
    c:/program files/java/jdk/src

  6. #6
    dewitrydan is offline Member
    Join Date
    Aug 2010
    Posts
    67
    Rep Power
    0

    Default

    I can't find it :( I'm using snow leopard

  7. #7
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,755
    Rep Power
    7

    Default

    Eclipse is capable of showing the source of classes in the Java API. You may have to change a setting/preference.

  8. #8
    dewitrydan is offline Member
    Join Date
    Aug 2010
    Posts
    67
    Rep Power
    0

    Default

    what setting? I can't find anything :(

  9. #9
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,361
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by dewitrydan View Post
    I can't find it :( I'm using snow leopard
    Go to Project>Properties>Java Build Path>Libraries; open one of the .jar references (click the small triangle on the left of it) and edit the Source Attachment property of the .jar (make it point to your JDK/src.zip).

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  10. #10
    dewitrydan is offline Member
    Join Date
    Aug 2010
    Posts
    67
    Rep Power
    0

    Default

    thanks but I can't find the src.zip anywhere :(

  11. #11
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,361
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by dewitrydan View Post
    thanks but I can't find the src.zip anywhere :(
    Go to the directory where your JDK is stored (it is next to the directory where your JRE is stored). The src.zip file is supposed to be stored in that directory.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. source line counter in eclipse 3.0?
    By makpandian in forum Eclipse
    Replies: 1
    Last Post: 01-08-2011, 06:50 PM
  2. Configuring Java source folders for eclipse
    By kfir.wolfson@gmail.com in forum Eclipse
    Replies: 8
    Last Post: 10-01-2010, 12:11 PM
  3. source not found eclipse
    By prashantchouhan9 in forum Eclipse
    Replies: 13
    Last Post: 08-11-2010, 08:05 AM
  4. python source to java source converter?
    By conor147 in forum New To Java
    Replies: 0
    Last Post: 01-15-2010, 05:14 AM
  5. Eclipse with VERY LARGE source trees
    By wyrickre in forum Eclipse
    Replies: 0
    Last Post: 02-01-2008, 02:23 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
  •