美文网首页
Tip-javap 指令的用途与使用

Tip-javap 指令的用途与使用

作者: cctoken | 来源:发表于2019-06-22 21:33 被阅读0次

    javap 简介

    Disassembles one or more class files.
    及反汇编一个或多个class文件

    使用介绍

    javap [options] classfile ...
    classfile 使用 classpath下的或者classfile 描述本身是全路径的。
    options 是命令行参数
    javap 的输出默认是到 stdout

    Options 详解

    • -help --help -?

    • -version
      print release information

    • -l
      prints line and local variable tables

    • -public
      shows only public classes and members

    • -protected
      Shows only protected and public classes and members.

    • -private -p
      Shows all classes and members.

    • -Joption
      Passes the specified option to the JVM

    • -s
      Prints internal type signatures.

    • -sysinfo
      Shows system information (path, size, date, MD5 hash) of the class being processed.

    • -constants
      Shows static final constants.

    • -c
      Prints disassembled code, for example, the instructions that comprise the Java bytecodes, for each of the methods in the class.

    • -verbose
      Prints stack size, number of locals and arguments for methods.

    • -classpath path
      Specifies the path the javap command uses to look up classes. Overrides the default or the CLASSPATH environment variable when it is set.

    • -bootclasspath path
      Specifies the path from which to load bootstrap classes. By default, the bootstrap classes are the classes that implement the core Java platform located in jre/lib/rt.jar and several other JAR files.

    • -extdir dirs
      Overrides the location at which installed extensions are searched for. The default location for extensions is the value of java.ext.dirs.

    使用下来 javap -verbose 的使用更有意义一点

    相关文章

      网友评论

          本文标题:Tip-javap 指令的用途与使用

          本文链接:https://www.haomeiwen.com/subject/ljtbqctx.html