Thursday, 15 May 2014

eclipse - Relative Path setting in JAVA -


I am trying to use a config.xml file from my JAVA program. But it shows me "file not found" here is my project structure. I am using eclipse.

Enter image details here

So now I have "conf / Config-file.xml "How do I want to read?
Note:

  • I can not change the project structure.
  • 'conf' and 'bin' are not under '/ root'. They are just under a normal project directory.

    Please help please !!

    By using the "user.dir" property of the Java system variable, you can access your file .

      System.getProperty ("user.dir") + file. Separator + "conf" + File.Sseparator + "config-file.xml"    

No comments:

Post a Comment