8 Replies Latest reply: Aug 8, 2008 6:48 AM by mlk RSS

    Reading .txt file from classpath

    807589
      Hi all,

      I am using eclipse to develop a project where i need to read .txt files from a external folder. I added that folder to classpath and can see it using System.getProperty("java.class.path");.
      When I use ClassLoader.getSystemClassLoader().getResource("x\\abc.txt") to read a file it does not work. I was wondering why i can see target folder in the classpath but getResource does not
      read a file from it.

      Folder structure is like this:

      main
      ----------x------files
      ----------y------files

      Thanks in advance.