zoukankan      html  css  js  c++  java
  • Java命令学习系列(六)——jinfo

    jinfo可以输出java进程、core文件或远程debug服务器的配置信息。这些配置信息包括JAVA系统参数及命令行参数,如果进程运行在64位虚拟机上,需要指明-J-d64参数,如:jinfo -J-d64 -sysprops pid

    另外,Java7的官方文档指出,这一命令在后续的版本中可能不再使用。笔者使用的版本(jdk8)中已经不支持该命令(笔者翻阅了java8中该命令的文档,其中已经明确说明不再支持)。提示如下:

     1 HollisMacBook-Air:test-workspace hollis$ jinfo 92520
     2 Attaching to process ID 92520, please wait...
     3 ^@
     4 
     5 Exception in thread "main" java.lang.reflect.InvocationTargetException
     6     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     7     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
     8     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     9     at java.lang.reflect.Method.invoke(Method.java:606)
    10     at sun.tools.jinfo.JInfo.runTool(JInfo.java:97)
    11     at sun.tools.jinfo.JInfo.main(JInfo.java:71)
    12 Caused by: sun.jvm.hotspot.runtime.VMVersionMismatchException: Supported versions are 24.79-b02. Target VM is 25.40-b25
    13     at sun.jvm.hotspot.runtime.VM.checkVMVersion(VM.java:234)
    14     at sun.jvm.hotspot.runtime.VM.<init>(VM.java:297)
    15     at sun.jvm.hotspot.runtime.VM.initialize(VM.java:368)
    16     at sun.jvm.hotspot.bugspot.BugSpotAgent.setupVM(BugSpotAgent.java:598)
    17     at sun.jvm.hotspot.bugspot.BugSpotAgent.go(BugSpotAgent.java:493)
    18     at sun.jvm.hotspot.bugspot.BugSpotAgent.attach(BugSpotAgent.java:331)
    19     at sun.jvm.hotspot.tools.Tool.start(Tool.java:163)
    20     at sun.jvm.hotspot.tools.JInfo.main(JInfo.java:128)
    21     ... 6 more

    由于打印jvm常用信息可以使用Jps命令,并且在后续的java版本中可能不再支持,所以这个命令笔者就不详细介绍了。下面给出help信息,读者可自行阅读使用。(这就好像上高中,老师讲到一些难点的时候说,不明白也不要紧,知道有这么一回事就可以了!)

    用法摘要

    以键值对的形式打印出JAVA系统参数及命令行参数的名称和内容。

     1 -flag name
     2 prints the name and value of the given command line flag.
     3 -flag [+|-]name
     4 enables or disables the given boolean command line flag.
     5 -flag name=value
     6 sets the given command line flag to the specified value.
     7 -flags
     8 prints command line flags passed to the JVM. pairs.
     9 -sysprops
    10 prints Java System properties as name, value pairs.
    11 -h
    12 prints a help message
    13 -help
    14 prints a help message

    参考资料

    jinfo

  • 相关阅读:
    core.net 创建coreclass 项目出现一些问题
    【BZOJ4144】[AMPPZ2014]Petrol 最短路+离线+最小生成树
    【BZOJ4774/4006】修路/[JLOI2015]管道连接 斯坦纳树
    【BZOJ2595】[Wc2008]游览计划 斯坦纳树
    【BZOJ4149】[AMPPZ2014]Global Warming 单调栈+RMQ+二分
    【BZOJ4764】弹飞大爷 LCT
    【BZOJ3529】[Sdoi2014]数表 莫比乌斯反演+树状数组
    【BZOJ5008】方师傅的房子 三角剖分
    【BZOJ4282】慎二的随机数列 乱搞
    【BZOJ1568】[JSOI2008]Blue Mary开公司 线段树
  • 原文地址:https://www.cnblogs.com/lgjava/p/10833019.html
Copyright © 2011-2022 走看看