输出System.getProperties()所有属性及值的代码如下:
/**
* @from www.ityuan.com
* @Description:输出System.getProperties()所有属性及值
*/
public class ListWorkPropertiesTester {
public static void main(String[] args) {
Set sets = System.getProperties().entrySet();
for (Entrye : sets) {
System.out.println("【key】:"+e.getKey()+"----->【value】:"+e.getValue());
}
}
}
行结果如下:
【key】:java.runtime.name----->【value】:Java(TM) SE Runtime Environment
【key】:sun.boot.library.path----->【value】:C:\Program Files (x86)\Java\jdk1.6.0_10\jre\bin
【key】:java.vm.version----->【value】:11.0-b15
【key】:java.vm.vendor----->【value】:Sun Microsystems Inc.
【key】:java.vendor.url----->【value】:http://java.sun.com/
【key】:path.separator----->【value】:;
【key】:java.vm.name----->【value】:Java HotSpot(TM) Client VM
【key】:file.encoding.pkg----->【value】:sun.io
【key】:sun.java.launcher----->【value】:SUN_STANDARD
【key】:user.country----->【value】:CN
【key】:sun.os.patch.level----->【value】:Service Pack 1
【key】:java.vm.specification.name----->【value】:Java Virtual Machine Specification
【key】:user.dir----->【value】:D:\ityuan\workspace\DemoAll
【key】:java.runtime.version----->【value】:1.6.0_10-rc2-b32
【key】:java.awt.graphicsenv----->【value】:sun.awt.Win32GraphicsEnvironment
【key】:java.endorsed.dirs----->【value】:C:\Program Files (x86)\Java\jdk1.6.0_10\jre\lib\endorsed
【key】:os.arch----->【value】:x86
【key】:java.io.tmpdir----->【value】:C:\Users\ADMINI~1.WIN\AppData\Local\Temp\
【key】:line.separator----->【value】:
【key】:java.vm.specification.vendor----->【value】:Sun Microsystems Inc.
【key】:user.variant----->【value】:
【key】:os.name----->【value】:Windows Vista
【key】:sun.jnu.encoding----->【value】:GBK
【key】:java.library.path----->【value】:C:\Program Files (x86)\Java\jdk1.6.0_10\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files (x86)/Java/jdk1.6.0_10/bin/../jre/bin/client;C:/Program Files (x86)/Java/jdk1.6.0_10/bin/../jre/bin;C:/Program Files (x86)/Java/jdk1.6.0_10/bin/../jre/lib/i386;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Java\jdk1.6.0_10\bin;C:\Program Files\Broadcom\Broadcom 802.11 Network Adapter\Driver;;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\TortoiseSVN\bin;C:\jruby-1.6.8\bin;C:\Program Files (x86)\MySQL\MySQL Server 5.0\bin;c:\jruby-1.6.8\bin;D:\eclipse-SDK-4.3.2-win32\eclipse;
【key】:java.specification.name----->【value】:Java Platform API Specification
【key】:java.class.version----->【value】:50.0
【key】:sun.management.compiler----->【value】:HotSpot Client Compiler
【key】:os.version----->【value】:6.1
【key】:user.home----->【value】:C:\Users\Administrator.WIN-LNS9GDKO30J
【key】:user.timezone----->【value】:
【key】:java.awt.printerjob----->【value】:sun.awt.windows.WPrinterJob
【key】:file.encoding----->【value】:UTF-8
【key】:java.specification.version----->【value】:1.6
【key】:java.class.path----->【value】:D:\ityuan\workspace\DemoAll\bin;D:\ityuan\workspace\DemoAll\lib\opencsv-2.1.jar
【key】:user.name----->【value】:Administrator
【key】:java.vm.specification.version----->【value】:1.0
【key】:java.home----->【value】:C:\Program Files (x86)\Java\jdk1.6.0_10\jre
【key】:sun.arch.data.model----->【value】:32
【key】:user.language----->【value】:zh
【key】:java.specification.vendor----->【value】:Sun Microsystems Inc.
【key】:awt.toolkit----->【value】:sun.awt.windows.WToolkit
【key】:java.vm.info----->【value】:mixed mode, sharing
【key】:java.version----->【value】:1.6.0_10-rc2
【key】:java.ext.dirs----->【value】:C:\Program Files (x86)\Java\jdk1.6.0_10\jre\lib\ext;C:\Windows\Sun\Java\lib\ext
【key】:sun.boot.class.path----->【value】:C:\Program Files (x86)\Java\jdk1.6.0_10\jre\lib\resources.jar;C:\Program Files (x86)\Java\jdk1.6.0_10\jre\lib\rt.jar;C:\Program Files (x86)\Java\jdk1.6.0_10\jre\lib\sunrsasign.jar;C:\Program Files (x86)\Java\jdk1.6.0_10\jre\lib\jsse.jar;C:\Program Files (x86)\Java\jdk1.6.0_10\jre\lib\jce.jar;C:\Program Files (x86)\Java\jdk1.6.0_10\jre\lib\charsets.jar;C:\Program Files (x86)\Java\jdk1.6.0_10\jre\classes
【key】:java.vendor----->【value】:Sun Microsystems Inc.
【key】:file.separator----->【value】:\
【key】:java.vendor.url.bug----->【value】:http://java.sun.com/cgi-bin/bugreport.cgi
【key】:sun.io.unicode.encoding----->【value】:UnicodeLittle
【key】:sun.cpu.endian----->【value】:little
【key】:sun.desktop----->【value】:windows
【key】:sun.cpu.isalist----->【value】:pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86