日期:2014-05-17 浏览次数:20842 次
package com.lveyo.java.lite.system; import java.util.Properties; public class SystemProperties { public static void main(String[] args) { Properties props = System.getProperties(); System.out.println("Java Version: " + props.getProperty("java.version")); System.out.println("Java Vendor: " + props.getProperty("java.vendor")); System.out.println("JVM Version: " + props.getProperty("java.vm.version")); System.out.println("Java Specification Version: " + props.getProperty("java.specification.version")); System.out.println("OS name: " + props.getProperty("os.name")); System.out.println("OS architecture: " + props.getProperty("os.arch")); System.out.println("OS Version: " + props.getProperty("os.version")); System.out.println("File Encoding: " + props.getProperty("file.encoding")); System.out.println("User Language: " + props.getProperty("user.language")); } }
Java Version: 1.6.0_24 Java Vendor: Sun Microsystems Inc. JVM Version: 19.1-b02 Java Specification Version: 1.6 OS name: Windows 7 OS architecture: x86 OS Version: 6.1 File Encoding: UTF-8 User Language: zh
D:\LiteJava\bin>java com.lveyo.java.lite.system.SystemProperties Java Version: 1.6.0_21 Java Vendor: Sun Microsystems Inc. JVM Version: 17.0-b16 Java Specification Version: 1.6 OS name: Windows 7 OS architecture: x86 OS Version: 6.1 File Encoding: GBK User Language: zh