System.getProperties() 可以得到很多系统的属性,如下:
{java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition,
sun.boot.library.path=C:\Program Files\Java\j2re1.4.2_09\bin,
java.vm.version=1.4.2_09-b05,
java.vm.vendor=Sun Microsystems Inc.,
java.vendor.url=http://java.sun.com/,
path.separator=;,
java.vm.name=Java HotSpot(TM) Client VM,
file.encoding.pkg=sun.io,
 user.country=CN,
sun.os.patch.level=Service Pack 2,
java.vm.specification.name=Java Virtual Machine Specification,
user.dir=D:\workspace\test,
java.runtime.version=1.4.2_09-b05,
java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment,
java.endorsed.dirs=C:\Program Files\Java\j2re1.4.2_09\lib\endorsed,
os.arch=x86,
java.io.tmpdir=C:\DOCUME~1\szb\LOCALS~1\Temp\,
line.separator= ,
java.vm.specification.vendor=Sun Microsystems Inc.,
user.variant=,
os.name=Windows XP,
sun.java2d.fontpath=,
java.library.path=C:\Program Files\Java\j2re1.4.2_09\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;D:\apache-ant-1.6.5\bin;D:\jdk1.5.0_05\bin,
java.specification.name=Java Platform API Specification,
java.class.version=48.0,
java.util.prefs.PreferencesFactory=java.util.prefs.WindowsPreferencesFactory,
os.version=5.1,
user.home=C:\Documents and Settings\szb,
user.timezone=,
java.awt.printerjob=sun.awt.windows.WPrinterJob,
file.encoding=GBK,
java.specification.version=1.4,
java.class.path=D:\workspace\test,
user.name=szb,
java.vm.specification.version=1.0,
java.home=C:\Program Files\Java\j2re1.4.2_09,
sun.arch.data.model=32,
user.language=zh,
java.specification.vendor=Sun Microsystems Inc.,
awt.toolkit=sun.awt.windows.WToolkit,
java.vm.info=mixed mode,
java.version=1.4.2_09,
java.ext.dirs=C:\Program Files\Java\j2re1.4.2_09\lib\ext,
sun.boot.class.path=C:\Program Files\Java\j2re1.4.2_09\lib\rt.jar;C:\Program Files\Java\j2re1.4.2_09\lib\i18n.jar;C:\Program Files\Java\j2re1.4.2_09\lib\sunrsasign.jar;C:\Program Files\Java\j2re1.4.2_09\lib\jsse.jar;C:\Program Files\Java\j2re1.4.2_09\lib\jce.jar;C:\Program Files\Java\j2re1.4.2_09\lib\charsets.jar;C:\Program Files\Java\j2re1.4.2_09\classes,
java.vendor=Sun Microsystems Inc.,
file.separator=\,
java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi,
sun.io.unicode.encoding=UnicodeLittle,
sun.cpu.endian=little,
sun.cpu.isalist=pentium i486 i386}