Results 1 to 7 of 7
  1. #1
    argus is offline Member
    Join Date
    Oct 2010
    Posts
    11
    Rep Power
    0

    Default read source code from a class

    Hello all,

    is there a way to display the source code of a class in an application and give it to a String variable?So i can get the values given by one class or even a package?

    Something like:
    Java Code:
    String classSource[]=new String[](java.lang.String.*)
    What i want is similar to the NetBeans IDE feature where the Methods and values pops up in a window with the javadoc if you import a class or operate with values.Hope you know what i mean.
    I guess,the better question is,how NetBeans does this?

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,520
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by argus View Post
    Hello all,

    is there a way to display the source code of a class in an application and give it to a String variable?So i can get the values given by one class or even a package?
    You can't get the source file if you have just a class. All you can do is decompile the class(file) but it is extremely unlikely that the result will be identical to the original source file.

    kind regards,

    Jos

  3. #3
    argus is offline Member
    Join Date
    Oct 2010
    Posts
    11
    Rep Power
    0

    Default

    What do you mean with decompile? Sry, i can't imagine how to decompile a class and how it could look then.Can you explain or do you know where is good reading to this subject?:confused:
    thank you for the Help.

  4. #4
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,520
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by argus View Post
    What do you mean with decompile?
    Is Google down in your part of the world? Try it with the search string "Java decompiler".

    kind regards,

    Jos

  5. #5
    argus is offline Member
    Join Date
    Oct 2010
    Posts
    11
    Rep Power
    0

    Default

    maybe you know better than google,ok.

  6. #6
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,520
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by argus View Post
    maybe you know better than google,ok.
    Did you try to google for it?

    kind regards,

    Jos

  7. #7
    argus is offline Member
    Join Date
    Oct 2010
    Posts
    11
    Rep Power
    0

    Default

    doing it right now.There are some decompilers out there,have to look for one made in java.

Similar Threads

  1. Help me source code
    By choqi Amt in forum NetBeans
    Replies: 2
    Last Post: 07-18-2010, 09:57 AM
  2. Replies: 1
    Last Post: 11-28-2008, 06:27 PM
  3. Help me out in compiling the source code
    By aks.nitw in forum Advanced Java
    Replies: 3
    Last Post: 10-17-2008, 08:33 AM
  4. Organize class source code
    By Alejandro Valdez in forum Eclipse
    Replies: 0
    Last Post: 05-16-2008, 02:58 PM
  5. Need a source code
    By vissu007 in forum New To Java
    Replies: 1
    Last Post: 07-05-2007, 07:08 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
  •