src/main/java/org/jmxtrans/agent/util/PropertyPlaceholderResolver.java
protected String resolvePlaceholder(String property, String defaultValue) throws IllegalStateException {


        // "graphite.host" -> "GRAPHITE_HOST"
        String environmentVariableStyleProperty = property.toUpperCase();
        environmentVariableStyleProperty = environmentVariableStyleProperty.replaceAll("\\.", "_");

        String result;
        if (externalProperties.containsKey(property)) {
            result = externalProperties.get(property);
        } else if (System.getProperties().containsKey(property)) {
            result = System.getProperty(property);
        } else if (System.getenv().containsKey(property)) {
            result = System.getenv(property);
        } else if (System.getenv().containsKey(environmentVariableStyleProperty)) {
            result = System.getenv(environmentVariableStyleProperty);
        } else if (defaultValue != null) {
            result = defaultValue;
        } else {
            throw new IllegalStateException("Property '" + property + "' not found in System properties nor in Environment variables");
        }
        return result;
    }
protected String resolvePlaceholder(String property, String defaultValue) throws IllegalStateException {


        // "graphite.host" -> "GRAPHITE_HOST"
        String environmentVariableStyleProperty = property.toUpperCase();
        environmentVariableStyleProperty = environmentVariableStyleProperty.replaceAll("\\.", "_");

        String result;
        if (externalProperties.containsKey(property)) {
            result = externalProperties.get(property);
        } else if (System.getProperties().containsKey(property)) {
            result = System.getProperty(property);
        } else if (System.getenv().containsKey(property)) {
            result = System.getenv(property);
        } else if (System.getenv().containsKey(environmentVariableStyleProperty)) {
            result = System.getenv(environmentVariableStyleProperty);
        } else if (defaultValue != null) {
            result = defaultValue;
        } else {
            throw new IllegalStateException("Property '" + property + "' not found in System properties nor in Environment variables");
        }
        return result;
    }
Search for the given placeholder in system properties then in environment variables.

@param property     property to resolve
@param defaultValue Default value if the placeholder is not found. <code>null</code> means not default value is
defined and the placeholder must exist
@return the resolved property or the default value if the placeholder is not found and the default value is defined. Non null.
@throws IllegalStateException if the placeholder is not found and the given <code>defaultValue</code> is not
defined (<code>null</code>)