This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I have packaged a properties.xml file along with my class files inside a jar. My Code uses properites.xml file as following String propertyFilename = "properties.xml" InputStream is = ClassLoader.getSystemClassLoader().getResourceAsStream(propertyFileName); .... Document doc = XMLReader.getDocument(is); .... When I run this code my running class does not find the properties.xml thought the classpath is set to the jar (having the properties.xml file) file in which I packaged my properties.xml and the running class. using java -classpath C:\.......\build\aipUtil.jar runningclass If I put the file outside the jar and inside the dir build, then use the classpath using java -classpath C:\.......\aipUtil.jar;C:\......\build\. runningclass It works fine. Can someone please tell me how can I make my code see the properties.xml file inside my code while having the properties.xml file in the same jar. Manish