boolean (String a11yClassName) { String[] paths = new String[]{ System.getProperty("user.home") + File.separator + ".accessibility.properties", System.getProperty("java.home") + File.separator + "lib" + File.separator + "accessibility.properties" }; Properties properties = new Properties(); for (String path : paths) { try { try (InputStream in = Files.newInputStream(Paths.get(path))) { properties.load(in); } } catch (Exception ignore) { continue; } if (!properties.isEmpty()) break; } if (!properties.isEmpty()) { // First, check the system property String classNames = System.getProperty("javax.accessibility.assistive_technologies"); if (classNames == null) { // If the system property is not set, Toolkit will try to use the properties file. classNames = properties.getProperty("assistive_technologies", null); } if (classNames != null && classNames.contains(a11yClassName)) { return true; } } return false; }