java.version
Java 运行时环境版本java.vendorJava 运行时环境供应商java.vendor.urlJava 供应商的 URLjava.homeJava 安装目录java.vm.specification.versionJava 虚拟机规范版本java.vm.specification.vendorJava 虚拟机规范供应商java.vm.specification.nameJava 虚拟机规范名称java.vm.versionJava 虚拟机实现版本java.vm.vendorJava 虚拟机实现供应商java.vm.nameJava 虚拟机实现名称java.specification.versionJava 运行时环境规范版本java.specification.vendorJava 运行时环境规范供应商java.specification.nameJava 运行时环境规范名称java.class.versionJava 类格式版本号java.class.pathJava 类路径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用户的当前工作目录 获取的代码示例:[java] view plaincopypublic class SystemProperty { public static void main(String args[]) { 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_class_version:" + System.getProperty("java.class.version")); System.out.println("java_class_path:" + System.getProperty("java.class.path")); 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("user_name:" + System.getProperty("user.name")); System.out.println("user_home:" + System.getProperty("user.home")); System.out.println("user_dir:" + System.getProperty("user.dir")); 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_ext_dirs:" + System.getProperty("java.ext.dirs")); System.out.println("file_separator:" + System.getProperty("file.separator")); System.out.println("path_separator:" + System.getProperty("path.separator")); System.out.println("line_separator:" + System.getProperty("line.separator")); }