关键词搜索

源码搜索 ×
×

JDK8 JVM运行时系统级参数

发布2022-01-27浏览797次

详情内容

System.*调用

相关值的描述
java.versionJava 运行时环境版本
java.vendorJava 运行时环境供应商
java.vendor.urlJava 供应商的 URL
java.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用户的当前工作目录
  1. /**
  2. * Determines the current system properties.
  3. * <p>
  4. * First, if there is a security manager, its
  5. * <code>checkPropertiesAccess</code> method is called with no
  6. * arguments. This may result in a security exception.
  7. * <p>
  8. * The current set of system properties for use by the
  9. * {@link #getProperty(String)} method is returned as a
  10. * <code>Properties</code> object. If there is no current set of
  11. * system properties, a set of system properties is first created and
  12. * initialized. This set of system properties always includes values
  13. * for the following keys:
  14. * <table summary="Shows property keys and associated values">
  15. * <tr><th>Key</th>
  16. * <th>Description of Associated Value</th></tr>
  17. * <tr><td><code>java.version</code></td>
  18. * <td>Java Runtime Environment version</td></tr>
  19. * <tr><td><code>java.vendor</code></td>
  20. * <td>Java Runtime Environment vendor</td></tr>
  21. * <tr><td><code>java.vendor.url</code></td>
  22. * <td>Java vendor URL</td></tr>
  23. * <tr><td><code>java.home</code></td>
  24. * <td>Java installation directory</td></tr>
  25. * <tr><td><code>java.vm.specification.version</code></td>
  26. * <td>Java Virtual Machine specification version</td></tr>
  27. * <tr><td><code>java.vm.specification.vendor</code></td>
  28. * <td>Java Virtual Machine specification vendor</td></tr>
  29. * <tr><td><code>java.vm.specification.name</code></td>
  30. * <td>Java Virtual Machine specification name</td></tr>
  31. * <tr><td><code>java.vm.version</code></td>
  32. * <td>Java Virtual Machine implementation version</td></tr>
  33. * <tr><td><code>java.vm.vendor</code></td>
  34. * <td>Java Virtual Machine implementation vendor</td></tr>
  35. * <tr><td><code>java.vm.name</code></td>
  36. * <td>Java Virtual Machine implementation name</td></tr>
  37. * <tr><td><code>java.specification.version</code></td>
  38. * <td>Java Runtime Environment specification version</td></tr>
  39. * <tr><td><code>java.specification.vendor</code></td>
  40. * <td>Java Runtime Environment specification vendor</td></tr>
  41. * <tr><td><code>java.specification.name</code></td>
  42. * <td>Java Runtime Environment specification name</td></tr>
  43. * <tr><td><code>java.class.version</code></td>
  44. * <td>Java class format version number</td></tr>
  45. * <tr><td><code>java.class.path</code></td>
  46. * <td>Java class path</td></tr>
  47. * <tr><td><code>java.library.path</code></td>
  48. * <td>List of paths to search when loading libraries</td></tr>
  49. * <tr><td><code>java.io.tmpdir</code></td>
  50. * <td>Default temp file path</td></tr>
  51. * <tr><td><code>java.compiler</code></td>
  52. * <td>Name of JIT compiler to use</td></tr>
  53. * <tr><td><code>java.ext.dirs</code></td>
  54. * <td>Path of extension directory or directories
  55. * <b>Deprecated.</b> <i>This property, and the mechanism
  56. * which implements it, may be removed in a future
  57. * release.</i> </td></tr>
  58. * <tr><td><code>os.name</code></td>
  59. * <td>Operating system name</td></tr>
  60. * <tr><td><code>os.arch</code></td>
  61. * <td>Operating system architecture</td></tr>
  62. * <tr><td><code>os.version</code></td>
  63. * <td>Operating system version</td></tr>
  64. * <tr><td><code>file.separator</code></td>
  65. * <td>File separator ("/" on UNIX)</td></tr>
  66. * <tr><td><code>path.separator</code></td>
  67. * <td>Path separator (":" on UNIX)</td></tr>
  68. * <tr><td><code>line.separator</code></td>
  69. * <td>Line separator ("\n" on UNIX)</td></tr>
  70. * <tr><td><code>user.name</code></td>
  71. * <td>User's account name</td></tr>
  72. * <tr><td><code>user.home</code></td>
  73. * <td>User's home directory</td></tr>
  74. * <tr><td><code>user.dir</code></td>
  75. * <td>User's current working directory</td></tr>
  76. * </table>
  77. * <p>
  78. * Multiple paths in a system property value are separated by the path
  79. * separator character of the platform.
  80. * <p>
  81. * Note that even if the security manager does not permit the
  82. * <code>getProperties</code> operation, it may choose to permit the
  83. * {@link #getProperty(String)} operation.
  84. *
  85. * @return the system properties
  86. * @exception SecurityException if a security manager exists and its
  87. * <code>checkPropertiesAccess</code> method doesn't allow access
  88. * to the system properties.
  89. * @see #setProperties
  90. * @see java.lang.SecurityException
  91. * @see java.lang.SecurityManager#checkPropertiesAccess()
  92. * @see java.util.Properties
  93. */
  94. public static Properties getProperties() {
  95. SecurityManager sm = getSecurityManager();
  96. if (sm != null) {
  97. sm.checkPropertiesAccess();
  98. }
  99. return props;
  100. }

相关技术文章

点击QQ咨询
开通会员
返回顶部
×
微信扫码支付
微信扫码支付
确定支付下载
请使用微信描二维码支付
×

提示信息

×

选择支付方式

  • 微信支付
  • 支付宝付款
确定支付下载