public static String readValue(String filePath,String key) { Properties props = new Properties(); try { InputStream in = new BufferedInputStream (new FileInputStream(filePath)); props.load(in); String value = props.getProperty (key); System.out.println(key+value); return value; } catch (Exception e) { e.printStackTrace(); return null; } }