Bytecode related products

  • Start from the source code can then passjavacThe command is available.classThis file is a binary file and cannot be opened by normal editors
  • from.classthroughjavapTo get the parsing file of the bytecode (visualization)
  • Open it directly with HexDump (you can use the HexDump plugin in VS Code).classYou can see the binary code
  • With IDEA directly open, on the analysis of Java source code

Bytecode structure

  • The structure of bytecode is layered and nested, and there are two main types,
    • A typical 2-byte property (analogous to a basic data type in Java)
    • Compound data structure with size of N bytes (analogous to Java Object)
  • Magic number fixed ascafe babeIs used to determine whether or not.classfile
  • The ones marked green are the more important composite data structures
  • Class Name.Super ClassName.Interface SetsInformation determines the inheritance structure of the class