[初级]Java命令学习系列(六)——jinfo
生活随笔
收集整理的這篇文章主要介紹了
[初级]Java命令学习系列(六)——jinfo
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
轉載自?[初級]Java命令學習系列(六)——jinfo
jinfo可以輸出java進程、core文件或遠程debug服務器的配置信息。這些配置信息包括JAVA系統參數及命令行參數,如果進程運行在64位虛擬機上,需要指明-J-d64參數,如:jinfo -J-d64 -sysprops pid
另外,Java7的官方文檔指出,這一命令在后續的版本中可能不再使用。筆者使用的版本(jdk8)中已經不支持該命令(筆者翻閱了java8中該命令的文檔,其中已經明確說明不再支持)。提示如下:
HollisMacBook-Air:test-workspace hollis$ jinfo 92520 Attaching to process ID 92520, please wait... ^@Exception in thread "main" java.lang.reflect.InvocationTargetExceptionat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:606)at sun.tools.jinfo.JInfo.runTool(JInfo.java:97)at sun.tools.jinfo.JInfo.main(JInfo.java:71) Caused by: sun.jvm.hotspot.runtime.VMVersionMismatchException: Supported versions are 24.79-b02. Target VM is 25.40-b25at sun.jvm.hotspot.runtime.VM.checkVMVersion(VM.java:234)at sun.jvm.hotspot.runtime.VM.<init>(VM.java:297)at sun.jvm.hotspot.runtime.VM.initialize(VM.java:368)at sun.jvm.hotspot.bugspot.BugSpotAgent.setupVM(BugSpotAgent.java:598)at sun.jvm.hotspot.bugspot.BugSpotAgent.go(BugSpotAgent.java:493)at sun.jvm.hotspot.bugspot.BugSpotAgent.attach(BugSpotAgent.java:331)at sun.jvm.hotspot.tools.Tool.start(Tool.java:163)at sun.jvm.hotspot.tools.JInfo.main(JInfo.java:128)... 6 more由于打印jvm常用信息可以使用Jps命令,并且在后續的java版本中可能不再支持,所以這個命令筆者就不詳細介紹了。下面給出help信息,讀者可自行閱讀使用。(這就好像上高中,老師講到一些難點的時候說,不明白也不要緊,知道有這么一回事就可以了!)
用法摘要
以鍵值對的形式打印出JAVA系統參數及命令行參數的名稱和內容。
-flag name prints the name and value of the given command line flag. -flag [+|-]name enables or disables the given boolean command line flag. -flag name=value sets the given command line flag to the specified value. -flags prints command line flags passed to the JVM. pairs. -sysprops prints Java System properties as name, value pairs. -h prints a help message -help prints a help message總結
以上是生活随笔為你收集整理的[初级]Java命令学习系列(六)——jinfo的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: [中级]Java命令学习系列(五)——j
- 下一篇: 9个最佳科技标识以及如何制作自己的[20