System.getProperty("user.dir") cannot get my project root path ,but the path which my eclipse is located
- by facebook-100005613813158
As the title goes , I have class named GetException.java,inside it ,I read a xml file in a static code block like(Because this document is shared):
static{
...
document = db.parse(new File(System.getProperty("user.dir")+"/src/exception/ExceptionCode.xml"));
...
}
To test if the file path is correct, I write a main function just inside…