本帖最后由 t_mac 于 2011-12-13 10:06 编辑
[import java.util.*;
public class SystemInfo {
public static void main(String[] args) {
Properties pro = System.getProperties();
for(Object o:pro.keySet()){
String s = (String)o;
System.out.println(s+".."+pro.get(s));
}
}
}]
我通过这个类获取系统信息,结果让我惊了一下,os name 居然是 Windows Vista 我明明装的是Windows7 啊,怎么会是Vista呢?求解释!
java.runtime.name..Java(TM) SE Runtime Environment
sun.boot.library.path..C:\Users\asus\AppData\Local\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre\bin
java.vm.version..11.3-b02
java.vm.vendor..Sun Microsystems Inc.
java.vendor.url..http://java.sun.com/
path.separator..;
java.vm.name..Java HotSpot(TM) 64-Bit Server VM
file.encoding.pkg..sun.io
sun.java.launcher..SUN_STANDARD
user.country..CN
……
java.vm.specification.vendor..Sun Microsystems Inc.
user.variant..
os.name..Windows Vista
sun.jnu.encoding..GBK
java.library.path..C:\Users\asus\AppData\Local\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Users\asus\AppData\Local\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre\bin;F:\app\asus\product\11.1.0\db_1\bin;.;C:\jdk6.0\bin;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;;C:\Program Files (x86)\Common Files\Thunder Network\KanKan\Codecs
java.specification.name..Java Platform API Specification
java.class.version..50.0
sun.management.compiler..HotSpot 64-Bit Server Compiler
os.version..6.1
user.home..C:\Users\asus
user.timezone..
java.awt.printerjob..sun.awt.windows.WPrinterJob
file.encoding..GBK
……
|