获取System基本配置信息
1.获取基本信息
package com.foo.test;public class App {/** * @param args */public static void main(String[] args) {String workingDir = System.getProperty("user.dir");System.out.println(workingDir);System.out.println(System.getProperty("java.version"));System.out.println(System.getProperty("user.home"));System.out.println(System.getProperty("user.name"));}}
/leehaut/homework/java/foo1.6.0_45/Users/lihaolihao
/** * System properties. The following properties are guaranteed to be defined: * <dl> * <dt>java.version<dd>Java version number * <dt>java.vendor<dd>Java vendor specific string * <dt>java.vendor.url<dd>Java vendor URL * <dt>java.home<dd>Java installation directory * <dt>java.class.version<dd>Java class version number * <dt>java.class.path<dd>Java classpath * <dt>os.name<dd>Operating System Name * <dt>os.arch<dd>Operating System Architecture * <dt>os.version<dd>Operating System Version * <dt>file.separator<dd>File separator ("/" on Unix) * <dt>path.separator<dd>Path separator (":" on Unix) * <dt>line.separator<dd>Line separator ("\n" on Unix) * <dt>user.name<dd>User account name * <dt>user.home<dd>User home directory * <dt>user.dir<dd>User's current working directory * </dl> */