首页 > 编程语言 >查看Java class文件元信息

查看Java class文件元信息

时间:2023-10-25 17:56:51浏览次数:41  
标签:lang Ljava Java 查看 Utf8 Object util java class

命令
javap -v /com/pany/Hello.class

输出:

D:\lab>javap -v LibEnvMap.class
Classfile /D:/lab/LibEnvMap.class
  Last modified 2023年10月25日; size 1442 bytes
  SHA-256 checksum 163a912c8adb9511d630c71483f134b2583e87a66ad8e46ace4fa30656e5af7e
  Compiled from "LibEnvMap.java"
public class LibEnvMap
  minor version: 0
  major version: 65
  flags: (0x0021) ACC_PUBLIC, ACC_SUPER
  this_class: #63                         // LibEnvMap
  super_class: #2                         // java/lang/Object
  interfaces: 0, fields: 0, methods: 2, attributes: 1
Constant pool:
   #1 = Methodref          #2.#3          // java/lang/Object."<init>":()V
   #2 = Class              #4             // java/lang/Object
   #3 = NameAndType        #5:#6          // "<init>":()V
   #4 = Utf8               java/lang/Object
   #5 = Utf8               <init>
   #6 = Utf8               ()V
   #7 = Methodref          #8.#9          // org/graalvm/nativeimage/c/type/CTypeConversion.toJavaString:(Lorg/graalvm/nativeimage/c/type/CCharPointer;)Ljava/lang/String;
   #8 = Class              #10            // org/graalvm/nativeimage/c/type/CTypeConversion
   #9 = NameAndType        #11:#12        // toJavaString:(Lorg/graalvm/nativeimage/c/type/CCharPointer;)Ljava/lang/String;
  #10 = Utf8               org/graalvm/nativeimage/c/type/CTypeConversion
  #11 = Utf8               toJavaString
  #12 = Utf8               (Lorg/graalvm/nativeimage/c/type/CCharPointer;)Ljava/lang/String;
  #13 = Methodref          #14.#15        // java/lang/System.getenv:()Ljava/util/Map;
  #14 = Class              #16            // java/lang/System
  #15 = NameAndType        #17:#18        // getenv:()Ljava/util/Map;
  #16 = Utf8               java/lang/System
  #17 = Utf8               getenv
  #18 = Utf8               ()Ljava/util/Map;
  #19 = InterfaceMethodref #20.#21        // java/util/Map.keySet:()Ljava/util/Set;
  #20 = Class              #22            // java/util/Map
  #21 = NameAndType        #23:#24        // keySet:()Ljava/util/Set;
  #22 = Utf8               java/util/Map
  #23 = Utf8               keySet
  #24 = Utf8               ()Ljava/util/Set;
  #25 = InterfaceMethodref #26.#27        // java/util/Set.iterator:()Ljava/util/Iterator;
  #26 = Class              #28            // java/util/Set
  #27 = NameAndType        #29:#30        // iterator:()Ljava/util/Iterator;
  #28 = Utf8               java/util/Set
  #29 = Utf8               iterator
  #30 = Utf8               ()Ljava/util/Iterator;
  #31 = InterfaceMethodref #32.#33        // java/util/Iterator.hasNext:()Z
  #32 = Class              #34            // java/util/Iterator
  #33 = NameAndType        #35:#36        // hasNext:()Z
  #34 = Utf8               java/util/Iterator
  #35 = Utf8               hasNext
  #36 = Utf8               ()Z
  #37 = InterfaceMethodref #32.#38        // java/util/Iterator.next:()Ljava/lang/Object;
  #38 = NameAndType        #39:#40        // next:()Ljava/lang/Object;
  #39 = Utf8               next
  #40 = Utf8               ()Ljava/lang/Object;
  #41 = Class              #42            // java/lang/String
  #42 = Utf8               java/lang/String
  #43 = Methodref          #41.#44        // java/lang/String.contains:(Ljava/lang/CharSequence;)Z
  #44 = NameAndType        #45:#46        // contains:(Ljava/lang/CharSequence;)Z
  #45 = Utf8               contains
  #46 = Utf8               (Ljava/lang/CharSequence;)Z
  #47 = Fieldref           #14.#48        // java/lang/System.out:Ljava/io/PrintStream;
  #48 = NameAndType        #49:#50        // out:Ljava/io/PrintStream;
  #49 = Utf8               out
  #50 = Utf8               Ljava/io/PrintStream;
  #51 = String             #52            // %s=%s%n
  #52 = Utf8               %s=%s%n
  #53 = InterfaceMethodref #20.#54        // java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
  #54 = NameAndType        #55:#56        // get:(Ljava/lang/Object;)Ljava/lang/Object;
  #55 = Utf8               get
  #56 = Utf8               (Ljava/lang/Object;)Ljava/lang/Object;
  #57 = Methodref          #58.#59        // java/io/PrintStream.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/PrintStream;
  #58 = Class              #60            // java/io/PrintStream
  #59 = NameAndType        #61:#62        // format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/PrintStream;
  #60 = Utf8               java/io/PrintStream
  #61 = Utf8               format
  #62 = Utf8               (Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/PrintStream;
  #63 = Class              #64            // LibEnvMap
  #64 = Utf8               LibEnvMap
  #65 = Utf8               Code
  #66 = Utf8               LineNumberTable
  #67 = Utf8               filterEnv
  #68 = Utf8               (Lorg/graalvm/nativeimage/IsolateThread;Lorg/graalvm/nativeimage/c/type/CCharPointer;)I
  #69 = Utf8               StackMapTable
  #70 = Class              #71            // org/graalvm/nativeimage/IsolateThread
  #71 = Utf8               org/graalvm/nativeimage/IsolateThread
  #72 = Class              #73            // org/graalvm/nativeimage/c/type/CCharPointer
  #73 = Utf8               org/graalvm/nativeimage/c/type/CCharPointer
  #74 = Utf8               RuntimeVisibleAnnotations
  #75 = Utf8               Lorg/graalvm/nativeimage/c/function/CEntryPoint;
  #76 = Utf8               name
  #77 = Utf8               filter_env
  #78 = Utf8               SourceFile
  #79 = Utf8               LibEnvMap.java
{
  public LibEnvMap();
    descriptor: ()V
    flags: (0x0001) ACC_PUBLIC
    Code:
      stack=1, locals=1, args_size=1
         0: aload_0
         1: invokespecial #1                  // Method java/lang/Object."<init>":()V
         4: return
      LineNumberTable:
        line 7: 0
}
SourceFile: "LibEnvMap.java"

标签:lang,Ljava,Java,查看,Utf8,Object,util,java,class
From: https://www.cnblogs.com/jiayuan2006/p/17787804.html

相关文章

  • Java 方法 01~06
    Java方法01~061.什么方法?方法概念:语句的集合;方法的命名规则:驼峰法则publicstaticintadd(inta,intb){returna+b;}//static类方法标识符//int返回值类型//inta,intb形参2.方法的定义和调用​ 定义要素:修饰符;返回值类型;方法名;参数类型;方法体......
  • 单词接龙(JAVA)
    classSolution{Map<String,Integer>wordId=newHashMap<String,Integer>();//哈希图,用于广度优先搜索List<List<Integer>>edge=newArrayList<List<Integer>>();//哈希图的邻接表,嵌套的两个一维数组组成的二维数组,......
  • Java基础 序列化流和反序列化流的 三个使用细节
    细节一:如果说一个类实现了Serializable接口,表示这个类的对象是可被序列化的,Java底层会根据这个类里面所有的内容进行计算,计算出一个long类型的序列号(或版本号)。假设计算出来的版本号是1,当我创建了一个这个类的对象的时候,在对象里面就包含了版本号1,用序列化流写到本地文......
  • 基于html5+javascript技术开发的房贷利率计算器,买房的码农们戳进来
    房贷计算器是一款专为购房者设计的实用工具应用,其主要功能是帮助用户详细计算房贷的还款金额、利息以及还款计划等。通过这款软件,用户可以更加便捷地了解到自己的还款情况和计划,从而更好地规划自己的财务。下面将对房贷计算器进行详细的介绍。体验地址房贷计算器体验地址关键......
  • JavaScript树型数据与一维数组相互转换方式
     /***@description一维数组转树形数据**/exportconstarrToTree=(data=[],conf={})=>(((data,{id='id',parentId='parentId',children='children'})=>{letresult=[]if(!Array.isArray(data)){r......
  • Java基础 序列化流、反序列化流
     序列化流是高级流,也是用来包装基本流的序列化流属于字节流的一种,负责输出数据;反序列化流负责输入数据 序列化流可以把Java中的对象写到本地文件中。但是写到文件中的数据我们看不懂,可以通过反序列化流把数据正确读取出来序列化流也叫对象操作输出流  序列......
  • JavaScript 中的深度克隆
    JavaScript中的深度克隆涉及创建一个新对象,该对象是现有对象的副本,并将复制延续到所有嵌套属性,以确保两个对象完全独立。这项技术对于保持程序中的不变性等任务至关重要,对于处理React等框架中的状态尤其重要。它有助于防止意外的对象突变可能引起的错误,从而产生更易于维护且无......
  • java的Long类型进行比较
    在Java中,对于Long类型的对象,如果它们包含的值在范围[-128,127]之间,它们会被缓存,以便在整数范围内进行重用。这是因为Java的自动装箱(autoboxing)机制的一部分。 问题:long类型127的比较 Long类型129的比较 如果你想在[-128,127]之外进行值的比较,而不是引用的比较,你应该使......
  • Dynamic CRM 部署ADFS 登陆超时时间查看及修改
    部署ADFS后,DynamicCRM登陆一段时间后会登陆失效。原因是在DynamicCRM所在的ADFS服务器中TokenLifetime默认值为0.1.查询ADFS的TokenLifetime在部署ADFS服务器里面,运行输入:PowerShell,输入代码:Get-ADFSRelyingPartyTrust"CRMIFDRelyingParty" 2.设置ADFS服务器TokenLif......
  • java DiffUtils文本差异对比实现
    1、首先引入mvn<dependency><groupId>io.github.java-diff-utils</groupId><artifactId>java-diff-utils</artifactId><version>4.11</version></dependency><dependency><groupId>org.apache.poi</......