Search code examples
javaeclipsefilereaderproperties-fileeclipse-neon

How to add folder of property files in eclipse


I shifted my project from tomcat to eclipse. All files are working fine but the folder containing property files are not working.

What I did so far:

  1. Added folder in project -> build
  2. created a source folder in project/src root and moved all
  3. Set the classpath environment variables
  4. Changed path with //, first folder without / etc.

but nothing worked for me. Here is screen shot:

enter image description here

Please advise where I am making mistake? My OS is windows 8 but I have to deploy on CentOS IDE: eclipse neon 3.0


Solution

  • After spending many hours I found the solution from this post

    Copying solution here:

    URL url = ConfigReader.class.getClassLoader().getResource("lang/global/settings.properties");
    String filename = url.getPath();