i create the property file under package of resources/common/configure/
then i create the code
Properties prop = new Properties();
try {
//load a properties file
prop.load(new FileInputStream("resources/common/configure/commonData.properties"));
//get the property value and print it out
System.out.println(prop.getProperty("id"));
} catch (IOException ex) {
ex.printStackTrace();
}
but i got the following error
java.io.FileNotFoundException: (The system cannot find the path specified)
please let me know how can i get this property file.
Try with
prop.load(getClass().getResourceAsStream("resources/common/configure/commonData.properties"));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With