properties - File not found error occur when read property file in java -


i create property file under package of resources/common/configure/

then create code

    properties prop = new properties();      try {            //load properties file         prop.load(new fileinputstream("resources/common/configure/commondata.properties"));             //get property value , print out             system.out.println(prop.getproperty("id"));       } catch (ioexception ex) {         ex.printstacktrace();     } 

but got following error

java.io.filenotfoundexception: (the system cannot find path specified) 

please let me know how can property file.

try

prop.load(getclass().getresourceasstream("resources/common/configure/commondata.properties")); 

Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c++ - Using OpenSSL in a multi-threaded application -

All overlapping substrings matching a java regex -