I'm trying to use .properties files for the first time, in which I stored some configuration information for my web application in Java, I have a class and a method dedicated to this, however, every time it returns me an exception like "FileNotFoundException: Unable to find the specified path". Here it is the code:
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;
public class ClassProperties {
private static Properties property_file;
public static String getConfProperty(String property){
String value = null;
try{
FileReader reader = new FileReader("src/java/Utilities/config.properties");
property_file = new Properties();
property_file.load(reader);
value = property_file.getProperty(property);
}
catch(FileNotFoundException e){
System.out.println(e);
}
catch (IOException ex){
System.out.println(ex);
}
return value;
}
}
from the root folder of the project I specified the path to the files, what did I wrong?