try { Properties properties = new Properties(); InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("Application.properties"); properties.load(inputStream); Enumeration enumeration = properties.propertyNames(); while (enumeration.hasMoreElements()){ String key = (String) enumeration.nextElement(); String value = properties.getProperty(key); hashmap.put(key,value); } } catch (IOException e) { e.printStackTrace(); }