获取系统各项信息
public static void main(String[] args) {
Properties p = System.getProperties();
Iterator<Entry<Object, Object>> it = p.entrySet().iterator();
while(it.hasNext()) {
Entry<Object, Object> ent = it.next();
System.out.println(ent.getKey() + ":" + ent.getValue());
}
}
获得系统当前语言环境
Locale locale = Locale.getDefault();
System.out.println(locale.getLanguage());
以上的source可以帮助我们来判断当前使用的系统的信息