System.getProperty()参数大全
查资料用:
java.versionJava RuntimeEnvironment version
java.vendor Java RuntimeEnvironment vendor
java.vendor.url Java vendorURL
java.home Javainstallation directory
java.vm.specification.version Java VirtualMachine specification version
java.vm.specification.vendor Java VirtualMachine specification vendor
java.vm.specification.name Java VirtualMachine specification name
java.vm.version Java VirtualMachine implementation version
java.vm.vendor Java VirtualMachine implementation vendor
java.vm.name Java VirtualMachine implementation name
java.specification.version Java RuntimeEnvironment specification version
java.specification.vendor Java RuntimeEnvironment specification vendor
java.specification.name Java RuntimeEnvironment specification name
java.class.version Java classformat version number
java.class.path Java classpath
java.library.path List of paths to search whenloading libraries
java.io.tmpdir Default temp file path
java.compiler Name of JIT compiler to use
java.ext.dirs Path of extension directory ordirectories
os.name Operating system name
os.arch Operating system architecture
os.version Operating system version
file.separator File separator ("/" on UNIX)path.separator Path separator (":" on UNIX)
line.separator Line separator ("n" on UNIX)
user.name User's account name
user.home User's home directory
user.dir User's current working directory
中文对照:
java.version Java 运行时环境版本
java.vendor Java 运行时环境供应商
java.vendor.url Java 供应商的 URL
java.home Java 安装目录
java.vm.specification.version Java 虚拟机规范版本
java.vm.specification.vendor Java 虚拟机规范供应商
java.vm.specification.name Java 虚拟机规范名称
java.vm.version Java 虚拟机实现版本
java.vm.vendor Java 虚拟机实现供应商
java.vm.name Java 虚拟机实现名称
java.specification.version Java 运行时环境规范版本
java.specification.vendor Java 运行时环境规范供应商
java.specification.name Java 运行时环境规范名称
java.class.version Java 类格式版本号
java.class.path Java 类路径
java.library.path 加载库时搜索的路径列表
java.io.tmpdir 默认的临时文件路径
java.compiler 要使用的 JIT 编译器的名称
java.ext.dirs 一个或多个扩展目录的路径
os.name 操作系统的名称
os.arch 操作系统的架构
os.version 操作系统的版本
file.separator 文件分隔符(在 UNIX 系统中是“/”)
path.separator 路径分隔符(在 UNIX 系统中是“:”)
line.separator 行分隔符(在 UNIX 系统中是“/n”)
user.name 用户的账户名称
user.home 用户的主目录
user.dir 用户的当前工作目录
代码:
publicstatic void main(String[] args) {
System.out.println("java.version:" +System.getProperty("java.version"));
System.out.println("java.vendor:" +System.getProperty("java.vendor"));
System.out.println("java.vendor.url:" +System.getProperty("java.vendor.url"));
System.out.println("java.home:" +System.getProperty("java.home"));
System.out.println("java.vm.specification.version:" +System.getProperty("java.vm.specification.version"));
System.out.println("java.vm.specification.vendor:" +System.getProperty("java.vm.specification.vendor"));
System.out.println("java.vm.specification.name:" +System.getProperty("java.vm.specification.name"));
System.out.println("java.vm.version:" +System.getProperty("java.vm.version"));
System.out.println("java.vm.vendor:" +System.getProperty("java.vm.vendor"));
System.out.println("java.vm.name:" +System.getProperty("java.vm.name"));
System.out.println("java.specification.version:" +System.getProperty("java.specification.version"));
System.out.println("java.specification.vendor:" +System.getProperty("java.specification.vendor"));
System.out.println("java.specification.name:" +System.getProperty("java.specification.name"));
System.out.println("java.class.version:" +System.getProperty("java.class.version"));
System.out.println("java.class.path:" +System.getProperty("java.class.path"));
System.out.println("java.library.path:" +System.getProperty("java.library.path"));
System.out.println("java.io.tmpdir:" +System.getProperty("java.io.tmpdir"));
System.out.println("java.compiler:" +System.getProperty("java.compiler"));
System.out.println("java.ext.dirs:" +System.getProperty("java.ext.dirs"));
System.out.println("os.name:"+ System.getProperty("os.name"));
System.out.println("os.arch:"+ System.getProperty("os.arch"));
System.out.println("os.version:" +System.getProperty("os.version"));
System.out.println("file.separator:" +System.getProperty("file.separator"));
System.out.println("line.separator:" +System.getProperty("line.separator"));
System.out.println("user.name:" +System.getProperty("user.name"));
System.out.println("user.home:" +System.getProperty("user.home"));
System.out.println("user.dir:"+ System.getProperty("user.dir"));
}
运行结果:
java.version:1.6.0_02
java.vendor:Sun Microsystems Inc.
java.vendor.url:http://java.sun.com/
java.home:D:Program FilesJavajdk1.6.0_02jre
java.vm.specification.version:1.0
java.vm.specification.vendor:Sun Microsystems Inc.
java.vm.specification.name:Java Virtual Machine Specification
java.vm.version:1.6.0_02-b06
java.vm.vendor:Sun Microsystems Inc.
java.vm.name:Java HotSpot(TM) Client VM
java.specification.version:1.6
java.specification.vendor:Sun Microsystems Inc.
java.specification.name:Java Platform API Specification
java.class.version:50.0
java.class.path:E:workspacetestWebRootWEB-INFclasses;E:workspacetestWebRootWEB-INFlibactivation.jar;
java.library.path:D:ProgramFilesJavajdk1.6.0_02bin;.;C:WINDOWSSunJavabin;C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem;C:ProgramFilesCommon FilesThunder NetworkKanKanCodecs;C:ProgramFilesMicrosoft SQL Server80ToolsBINN;C:Program FilesMicrosoftSQL Server80ToolsBinn;C:Program FilesMicrosoft SQLServer90DTSBinn;C:Program FilesMicrosoft SQLServer90Toolsbinn;C:Program FilesMicrosoft SQLServer90ToolsBinnVSShellCommon7IDE;C:ProgramFilesMicrosoft Visual Studio8Common7IDEPrivateAssemblies;D:ProgramFilesJavajdk1.6.0_02bin;C:Program FilesCommonFilesAdobeAGL;C:Program FilesSinoVoicejTTS 5.0DesktopBin;E:J2EEpluginsantapache-ant-1.7.1bin;C:ProgramFilesCVSNT;C:Program FilesStormIICodec;C:ProgramFilesStormII
java.io.tmpdir:C:DOCUME~1ADMINI~1LOCALS~1Temp
java.compiler:null
java.ext.dirs:D:ProgramFilesJavajdk1.6.0_02jrelibext;C:WINDOWSSunJavalibext
os.name:Windows 2003
os.arch:x86
os.version:5.2
file.separator:
line.separator:
user.name:Administrator
user.home:C:Documents and SettingsAdministrator
user.dir:E:workspacemvnforum