aspose file tools*
The moose likes Java in General and the fly likes How ClassLoader finds a properties file? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How ClassLoader finds a properties file?" Watch "How ClassLoader finds a properties file?" New topic
Author

How ClassLoader finds a properties file?

ming zhu
Greenhorn

Joined: Feb 13, 2001
Posts: 16
I have a properties file, called xxx.properties in the first search directory listed in PATH.
However, when I call ClassLoader.getSystemResourceAsStream("xxx.properties") I get a NULL.
Can someone explain to me why?
Thanks a lot!
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Are you sure you've set your CLASSPATH list to the correct values? (PATH doesn't mean anything much to a JVM).
kind regards
ming zhu
Greenhorn

Joined: Feb 13, 2001
Posts: 16
Is it possible at all to get the PATH, not the CLASSPATH, into a string?
Thanks a lot.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How ClassLoader finds a properties file?