文档章节

UltraEdit 执行javap命令

 江上湖人
发布于 2016/11/15 22:40
字数 878
阅读 14
收藏 0

UltraEdit 是一款很好用的文本编辑器,非常推荐使用

我们可以用编辑器来执行javap命令来分析class字节码文件

点击 运行DOS命令 输入

javap -v -p -c -s -l D:\esp\esp-portal\esp-portal-server\target\classes\test\jvmClass.class

后面class 是我本地文件

 

 

然后界面会输出字节码结果

Classfile /D:/esp/esp-portal/esp-portal-server/target/classes/test/jvmClass.class
  Last modified 2016-11-15; size 1095 bytes
  MD5 checksum 7a3b26fe550b25cb986906ad18ff619d
  Compiled from "jvmClass.java"
public class test.jvmClass
  minor version: 0
  major version: 50
  flags: ACC_PUBLIC, ACC_SUPER
Constant pool:
   #1 = Class              #2             // test/jvmClass
   #2 = Utf8               test/jvmClass
   #3 = Class              #4             // java/lang/Object
   #4 = Utf8               java/lang/Object
   #5 = Utf8               i
   #6 = Utf8               I
   #7 = Utf8               <clinit>
   #8 = Utf8               ()V
   #9 = Utf8               Code
  #10 = Fieldref           #1.#11         // test/jvmClass.i:I
  #11 = NameAndType        #5:#6          // i:I
  #12 = Utf8               LineNumberTable
  #13 = Utf8               LocalVariableTable
  #14 = Utf8               <init>
  #15 = Methodref          #3.#16         // java/lang/Object."<init>":()V
  #16 = NameAndType        #14:#8         // "<init>":()V
  #17 = Utf8               this
  #18 = Utf8               Ltest/jvmClass;
  #19 = Utf8               addI
  #20 = Utf8               (I)V
  #21 = Utf8               m
  #22 = Utf8               addI1
  #23 = Utf8               (Ltest/order;)I
  #24 = Methodref          #25.#27        // test/order.getPrice:()I
  #25 = Class              #26            // test/order
  #26 = Utf8               test/order
  #27 = NameAndType        #28:#29        // getPrice:()I
  #28 = Utf8               getPrice
  #29 = Utf8               ()I
  #30 = Utf8               o
  #31 = Utf8               Ltest/order;
  #32 = Utf8               StackMapTable
  #33 = Class              #34            // java/lang/Throwable
  #34 = Utf8               java/lang/Throwable
  #35 = Utf8               minus
  #36 = Fieldref           #37.#39        // java/lang/System.out:Ljava/io/PrintStream;
  #37 = Class              #38            // java/lang/System
  #38 = Utf8               java/lang/System
  #39 = NameAndType        #40:#41        // out:Ljava/io/PrintStream;
  #40 = Utf8               out
  #41 = Utf8               Ljava/io/PrintStream;
  #42 = String             #43            // 出现异常
  #43 = Utf8               出现异常
  #44 = Methodref          #45.#47        // java/io/PrintStream.println:(Ljava/lang/String;)V
  #45 = Class              #46            // java/io/PrintStream
  #46 = Utf8               java/io/PrintStream
  #47 = NameAndType        #48:#49        // println:(Ljava/lang/String;)V
  #48 = Utf8               println
  #49 = Utf8               (Ljava/lang/String;)V
  #50 = Methodref          #51.#53        // java/lang/Exception.printStackTrace:()V
  #51 = Class              #52            // java/lang/Exception
  #52 = Utf8               java/lang/Exception
  #53 = NameAndType        #54:#8         // printStackTrace:()V
  #54 = Utf8               printStackTrace
  #55 = Utf8               n
  #56 = Utf8               e
  #57 = Utf8               Ljava/lang/Exception;
  #58 = Utf8               SourceFile
  #59 = Utf8               jvmClass.java
{
  private static int i;
    descriptor: I
    flags: ACC_PRIVATE, ACC_STATIC

  static {};
    descriptor: ()V
    flags: ACC_STATIC
    Code:
      stack=1, locals=0, args_size=0
         0: iconst_0
         1: putstatic     #10                 // Field i:I
         4: return
      LineNumberTable:
        line 5: 0
      LocalVariableTable:
        Start  Length  Slot  Name   Signature

  public test.jvmClass();
    descriptor: ()V
    flags: ACC_PUBLIC
    Code:
      stack=1, locals=1, args_size=1
         0: aload_0
         1: invokespecial #15                 // Method java/lang/Object."<init>":()V
         4: return
      LineNumberTable:
        line 3: 0
      LocalVariableTable:
        Start  Length  Slot  Name   Signature
            0       5     0  this   Ltest/jvmClass;

  public synchronized void addI(int);
    descriptor: (I)V
    flags: ACC_PUBLIC, ACC_SYNCHRONIZED
    Code:
      stack=2, locals=2, args_size=2
         0: getstatic     #10                 // Field i:I
         3: iload_1
         4: iadd
         5: putstatic     #10                 // Field i:I
         8: return
      LineNumberTable:
        line 8: 0
        line 9: 8
      LocalVariableTable:
        Start  Length  Slot  Name   Signature
            0       9     0  this   Ltest/jvmClass;
            0       9     1     m   I

  public int addI1(test.order);
    descriptor: (Ltest/order;)I
    flags: ACC_PUBLIC
    Code:
      stack=2, locals=3, args_size=2
         0: aload_0
         1: dup
         2: astore_2
         3: monitorenter
         4: getstatic     #10                 // Field i:I
         7: aload_1
         8: invokevirtual #24                 // Method test/order.getPrice:()I
        11: iadd
        12: putstatic     #10                 // Field i:I
        15: getstatic     #10                 // Field i:I
        18: aload_2
        19: monitorexit
        20: ireturn
        21: aload_2
        22: monitorexit
        23: athrow
      Exception table:
         from    to  target type
             4    20    21   any
            21    23    21   any
      LineNumberTable:
        line 11: 0
        line 12: 4
        line 13: 15
        line 11: 21
      LocalVariableTable:
        Start  Length  Slot  Name   Signature
            0      24     0  this   Ltest/jvmClass;
            0      24     1     o   Ltest/order;
      StackMapTable: number_of_entries = 1
        frame_type = 255 /* full_frame */
          offset_delta = 21
          locals = [ class test/jvmClass, class test/order, class test/jvmClass ]
          stack = [ class java/lang/Throwable ]

  public void minus(int);
    descriptor: (I)V
    flags: ACC_PUBLIC
    Code:
      stack=2, locals=3, args_size=2
         0: bipush        10
         2: iload_1
         3: idiv
         4: istore_2
         5: goto          21
         8: astore_2
         9: getstatic     #36                 // Field java/lang/System.out:Ljava/io/PrintStream;
        12: ldc           #42                 // String 出现异常
        14: invokevirtual #44                 // Method java/io/PrintStream.println:(Ljava/lang/String;)V
        17: aload_2
        18: invokevirtual #50                 // Method java/lang/Exception.printStackTrace:()V
        21: return
      Exception table:
         from    to  target type
             0     5     8   Class java/lang/Exception
      LineNumberTable:
        line 19: 0
        line 20: 5
        line 22: 9
        line 24: 17
        line 26: 21
      LocalVariableTable:
        Start  Length  Slot  Name   Signature
            0      22     0  this   Ltest/jvmClass;
            0      22     1     n   I
            9      12     2     e   Ljava/lang/Exception;
      StackMapTable: number_of_entries = 2
        frame_type = 72 /* same_locals_1_stack_item */
          stack = [ class java/lang/Exception ]
        frame_type = 12 /* same */
}
SourceFile: "jvmClass.java"

这比直接在cmd命令行执行命令好多了

好吧 更重要的是我得去看看字节码格式了

© 著作权归作者所有

粉丝 2
博文 25
码字总数 18450
作品 0
上饶
私信 提问
如何让UltraEdit跑满CPU?

之前一直都在使用notepad++,总的来说notepad++还是个不错的选择,功能全面,使用操作人性化,但在处理一些大文件(300M以上)就显得很吃力了, 而且容易崩溃卡死,后来通过各种文本处理软件...

qiuhao1112
2016/05/05
485
0
UltraEdit 应用程序发生错误0xc0000417

最近安装了新版的UltraEdit, 但一运行就跳出错误对话框:“配置文件更新: Uedit32.exe - 应用程序错误: 应用程序发生异常 未知的软件异常 (0xc0000417),位置为 0x00ad72d5。”点击后,Ultra...

mjrao
2012/11/30
166
0
从开源社区复制到eclipse或者ultraedit中运行总是报错

为什么从开源网站直接copy的代码 运行时时不时出错呢? 无论是eclipse 还是 ultraedit 都有时报错。 有时 复制一个代码在ultraedit中不报错,能运行,而复制到eclipse 中就报错。 复制的代码...

不能宅每天运动
2016/01/18
186
3
请问UltraEdit是怎么设置才能执行oracle的存储过程的?

在UltraEdit里面编写和修改存储过程了,每次都要去oracle里面重新弄了才能执行,好像听说UltraEdit里面可以直接执行存储过程,但是百度了一下没有找到怎么配置的,所以来请教各路大神,帮帮忙...

何忆
2016/01/30
448
0
sh脚本异常:/bin/sh^M:bad interpreter

在Linux中执行.sh脚本,异常/bin/sh^M: bad interpreter: No such file or directory。 分析:这是不同系统编码格式引起的:在windows系统中编辑的.sh文件可能有不可见字符,所以在Linux系统...

洛水
2018/06/20
27
0

没有更多内容

加载失败,请刷新页面

加载更多

golang-字符串-地址分析

demo package mainimport "fmt"func main() {str := "map.baidu.com"fmt.Println(&str, str)str = str[0:5]fmt.Println(&str, str)str = "abc"fmt.Println(&s......

李琼涛
今天
4
0
Spring Boot WebFlux 增删改查完整实战 demo

03:WebFlux Web CRUD 实践 前言 上一篇基于功能性端点去创建一个简单服务,实现了 Hello 。这一篇用 Spring Boot WebFlux 的注解控制层技术创建一个 CRUD WebFlux 应用,让开发更方便。这里...

泥瓦匠BYSocket
今天
8
0
从0开始学FreeRTOS-(列表与列表项)-3

FreeRTOS列表&列表项的源码解读 第一次看列表与列表项的时候,感觉很像是链表,虽然我自己的链表也不太会,但是就是感觉很像。 在FreeRTOS中,列表与列表项使用得非常多,是FreeRTOS的一个数...

杰杰1号
今天
9
0
Java反射

Java 反射 反射是框架设计的灵魂(使用的前提条件:必须先得到代表的字节码的 Class,Class 类 用于表示.class 文件(字节码)) 一、反射的概述 定义:JAVA 反射机制是在运行状态中,对于任...

zzz1122334
今天
7
0
聊聊nacos的LocalConfigInfoProcessor

序 本文主要研究一下nacos的LocalConfigInfoProcessor LocalConfigInfoProcessor nacos-1.1.3/client/src/main/java/com/alibaba/nacos/client/config/impl/LocalConfigInfoProcessor.java p......

go4it
昨天
9
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部