Hi everybody,
I need to load some information from a *.properties file but I can’t load file. Reading docs I thought it should be simple but I don’t know why it isn’t.
try {
File file = new File("src/main/resources/config.properties");
InputStream input = new FileInputStream(file);
Properties prop = new Properties();
prop.load(input);
} catch (Exception ex) {
ex.printStackTrace();
}
This code gives me this error
java.io.FileNotFoundException: src/main/resources/config.properties (No such file or directory)
I tried other locations but without any success.
Could someone give me an hint?
Thank you very much.
Matteo