System.getProperty()参数大全
查资料用:java.version Runtime Environment versionjava.vendor Runtime Environment vendorjava.vendor.url vendor URLjava.home installation directoryjava.vm.specification.version Virtual Machine specification versionjava.vm.specification.vendor Virtual Machine specification vendorjava.vm.specification.name Virtual Machine specification namejava.vm.version Virtual Machine implementation versionjava.vm.vendor Virtual Machine implementation vendorjava.vm.name Virtual Machine implementation namejava.specification.version Runtime Environment specification versionjava.specification.vendor Runtime Environment specification vendorjava.specification.name Runtime Environment specification namejava.class.version class format version numberjava.class.path class pathjava.library.path List of paths to search when loading librariesjava.io.tmpdir Default temp file pathjava.compiler Name of JIT compiler to use
java.ext.dirs Path of extension directory or directoriesos.name Operating system nameos.arch Operating system architectureos.version Operating system versionfile.separator File separator ("/" on UNIX) path.separator Path separator (":" on UNIX)line.separator Line separator ("/n" on UNIX)user.name User's account nameuser.home User's home directoryuser.dir User's current working directory中文对照:
java.version Java 运行时环境版本
java.vendor Java 运行时环境供应商java.vendor.url Java 供应商的 URLjava.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 用户的当前工作目录
代码:
public static 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_02java.vendor:Sun Microsystems Inc.java.vendor.url:http://java.sun.com/java.home:D:/Program Files/Java/jdk1.6.0_02/jrejava.vm.specification.version:1.0java.vm.specification.vendor:Sun Microsystems Inc.java.vm.specification.name:Java Virtual Machine Specificationjava.vm.version:1.6.0_02-b06java.vm.vendor:Sun Microsystems Inc.java.vm.name:Java HotSpot(TM) Client VMjava.specification.version:1.6java.specification.vendor:Sun Microsystems Inc.java.specification.name:Java Platform API Specificationjava.class.version:50.0java.class.path:E:/workspace/test/WebRoot/WEB-INF/classes;E:/workspace/test/WebRoot/WEB-INF/lib/activation.jar;
java.library.path:D:/Program Files/Java/jdk1.6.0_02/bin;.;C:/WINDOWS/Sun/Java/bin;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;C:/Program Files/Common Files/Thunder Network/KanKan/Codecs;C:/Program Files/Microsoft SQL Server/80/Tools/BINN;C:/Program Files/Microsoft SQL Server/80/Tools/Binn/;C:/Program Files/Microsoft SQL Server/90/DTS/Binn/;C:/Program Files/Microsoft SQL Server/90/Tools/binn/;C:/Program Files/Microsoft SQL Server/90/Tools/Binn/VSShell/Common7/IDE/;C:/Program Files/Microsoft Visual Studio 8/Common7/IDE/PrivateAssemblies/;D:/Program Files/Java/jdk1.6.0_02/bin;C:/Program Files/Common Files/Adobe/AGL;C:/Program Files/SinoVoice/jTTS 5.0 Desktop/Bin;E:/J2EE/plugins/ant/apache-ant-1.7.1/bin;C:/Program Files/CVSNT;C:/Program Files/StormII/Codec;C:/Program Files/StormIIjava.io.tmpdir:C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/java.compiler:nulljava.ext.dirs:D:/Program Files/Java/jdk1.6.0_02/jre/lib/ext;C:/WINDOWS/Sun/Java/lib/extos.name:Windows 2003os.arch:x86os.version:5.2file.separator:/line.separator:
user.name:Administratoruser.home:C:/Documents and Settings/Administratoruser.dir:E:/workspace/mvnforum