Where to put properties file in eclipse and how to access the path both locally and on server
eclipse, java, properties
Solution
I assume you have maven project, you can put that properties file at `src/main/resources/app.properties` and change the code to read it as
getClass().getClassLoader().getResourceAsStream("/app.properties");
Problem
I saw some similar questions on this,but I don't understand them enough so i want to ask the question and tailor it my own way. I have a properties file that I store in src/main/resources, and then reference this in my code like so: ``` Properties prop = new Properties(); InputStream input = null; try { input = new FileInputStream("src/main/resources/app.properties"); // load a properties file prop.load(input); ``` this works locally, however when I create a .war file and deploy it to the sever it has no idea where the properties file is. Where do I put this properties file, and how do I reference it in the code, so that I can run it locally, and on the server without any problems?