Question

InputStream is = this.getClass().getResourceAsStream("/ParseExample/service1.xml");

The code above generates a java.io.IOException: Root is not accessible.

This is the structure of the project folder http://www.fileden.com/files/2010/5/28/2872707//projectfiles.JPG

How can I properly locate the file? What path should be used?

Was it helpful?

Solution

You need to put the files in the /res folder in your jar, see this example.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top