void () { Set<String> paths = new LinkedHashSet<>(); paths.add(System.getProperty(PROPERTIES_FILE)); paths.add(getCustomPropertiesFile()); // Don't use here SystemProperties.getUserHome(). Called too early to load extra class. paths.add(System.getProperty("user.home") + '/' + PROPERTIES_FILE_NAME); String homePath = getHomePath(true); for (Path binDir : getBinDirectories()) { paths.add(binDir.resolve(PROPERTIES_FILE_NAME).toString()); } Properties sysProperties = System.getProperties(); for (String path : paths) { Path file = path == null ? null : Paths.get(path); if (file == null) { continue; } try (Reader reader = Files.newBufferedReader(file)) { //noinspection NonSynchronizedMethodOverridesSynchronizedMethod new Properties() { @Override public Object put(Object key, Object value) { if (PROPERTY_HOME_PATH.equals(key) || PROPERTY_HOME.equals(key)) { log(path + ": '" + key + "' cannot be redefined"); } else if (!sysProperties.containsKey(key)) { sysProperties.setProperty((String)key, substituteVars((String)value, homePath)); } return null; } }.load(reader); } catch (NoSuchFileException | AccessDeniedException ignore) { } catch (IOException e) { log("Can't read property file '" + path + "': " + e.getMessage()); } } // check and fix conflicting properties if (SystemInfoRt.isJBSystemMenu) { sysProperties.setProperty("apple.laf.useScreenMenuBar", "false"); } }