Where (which properties file) does System.getProperty("key") reads from?

No need to add a separate file.

Use setProperties method.

To modify the existing set of system properties, use System.setProperties. This method takes a Properties object that has been initialized to contain the properties to be set. This method replaces the entire set of system properties with the new set represented by the Properties object.

Warning: Changing system properties is potentially dangerous and should be done with discretion. Many system properties are not reread after start-up and are there for informational purposes. Changing some properties may have unexpected side-effects.

Official Docs

If you still want to create :Example by docs


If you want to setup a custom property file for System.getProperty, this is what we here do:

  1. Create a base class as a base object for all the class you'll make for your web application.
  2. In base class, write this code
    java.io.InputStream is = loader.getResourceAsStream("custom system property filename");
    System.getProperties().load(is);
    

Well, the System.getProperty(String) returns properties that relate to the global system of a JVM. Here you can find a list of available properties.

If you want to load a custom file of properties, you should load this file in your own properties object of which you can find an example here. You should keep this Properties object seperate of the system properties. You should never just load your custom properties into the system properties. (You could do this via System.setProperties(Properties).) This is like defining global variables which is a sign of poor program design.