修改Environment.Java
Properties properties2 = new Properties(); for (Map.Entry & lt; Object, Object & gt; o: properties.entrySet()) { properties2.setProperty(o.getKey().toString(), o.getValue().toString()); } properties2.storeToXML(new FileOutputStream(path.toOSString() + "/properties.xml", false), project.getName() + " properties", "utf-8");
原因:
感觉很奇怪, 调试进Properties的代码看了一下.
public String getProperty(String key) { Object oval = super.get(key); String sval = (oval instanceof String) ? (String)oval : null; return ((sval == null) && (defaults != null)) ? defaults.getProperty(key) : sval; }
原来Properties这货, 不是String的属性.