In Netbeans IDE i am writing a java class which has some method. One method reads a xml file that I put in the src/resources folder. To access this xml I use the path “src/resources/xmlFile.xml”. When I run the class from the ID It works fine. No problem.
But I create the jar of the xml file with the classes. This jar is used with some other project This time method is unable to read the xml file.
What relative path I should use so the method will be able to read the xml? or what other solution could be?
Thanks
See this answer:
read file in classpath