代碼:
Properties externalResourceFile = new Properties(); String jarpath = System.getProperty("user.dir") + "/config/externalConfig.properties"; try { FileInputStream in = new FileInputStream(jarpath); externalResourceFile.load(in);
System.out.println(externalResourceFile.getProperty("indexPath"));
} catch (Exception e) { e.printStackTrace(); }