I have some problem in my eclipse settings. I am trying to open/use a XSD file in my class but it doesn't seem to find it as the code isn't using relative path. When I copy the absolute path from my computer and paste it, it seems to work. But I need to use relative path as this project will be exported and may be used by others.
This is what Im trying to do:
Schema schema = sf.newSchema(new File("myfilename.xsd"));
This is what I get in the console:
Failed to read schema document 'file:/Applications/Eclipse.app/Contents/MacOS/sisrep.xsd, because 1) could not find the document;
When I do Schema schema = sf.newSchema(new File("Users/username/etc/etcabsoultepath/myfilename.xsd"));
it works fine, so im guessing eclipse isn't using the relative path.
Also, this code is run on a servlet. I had imported a sample java application file and run a similar operation, and that file was getting the relative path as needed, but my project isnt able to. Is there any setting I need to change or specify in eclipse for my project? I tried add .\\
before the file name but it didnt seem to work.