Page 2 of 2 FirstFirst 12
Results 21 to 27 of 27
  1. #21
    novice is offline Member
    Join Date
    May 2010
    Posts
    30
    Rep Power
    0

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

    Default

    Hm, how about this code, what does it return?
    Java Code:
    import java.io.InputStream;
    
    public class T {
      public static void main(String[] args) {
        InputStream is = T.class.getResourceAsStream("T.class"); // *** changed ***
    
        System.out.println(is != null);
      }
    }

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

    Default

    Quote Originally Posted by novice View Post
    It returns false.
    Hm, it returns true for me. Have you set the separate source/class files option for your project?

    kind regards,

    Jos

    edit: or answer Fubarable's question first.

  4. #24
    novice is offline Member
    Join Date
    May 2010
    Posts
    30
    Rep Power
    0

    Default

    The result is true.

    I was doing a mistake to consider "src" folder for the class file. Actually "src" is a folder that contains java files whereas class files are stored in some other folder(build/classes) in Eclipse.

    Thanks to both of you (Fubarable, and Jos) for being so kind for regular help.

    regards

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

    Default

    So, has your problem been solved?

  6. #26
    novice is offline Member
    Join Date
    May 2010
    Posts
    30
    Rep Power
    0

    Default

    YES- It is solved.


    regards

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

    Default

    Wonderful, I'm glad of that. If you can, please go into the Thread Tools at the top and mark this thread solved. Thanks!

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Reg: File Reading Problem
    By balaji csc in forum New To Java
    Replies: 0
    Last Post: 11-06-2009, 04:22 PM
  2. Replies: 2
    Last Post: 05-31-2009, 05:03 PM
  3. Weird path problem when reading properties file
    By jerry_popperq in forum New To Java
    Replies: 0
    Last Post: 03-18-2009, 03:32 PM
  4. Problem with reading text from a .txt file
    By Gigi in forum New To Java
    Replies: 40
    Last Post: 01-22-2009, 03:22 AM
  5. Problem reading an xml file with AJAX
    By Fiona80 in forum XML
    Replies: 0
    Last Post: 12-17-2007, 08:02 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
  •