■本地JDK
■查看方式1
以十六进行形式打开文件
format-hex ./HelloWorld.class
===
CA FE BA BE 00 00 00 34 00 1D 0A 00 06 00 0F 09
===
HEX | 十进制 | jdk |
2E | 46 | jdk1.2 |
2F | 47 | jdk1.3 |
30 | 48 | jdk1.4 |
31 | 49 | jdk1.5 |
32 | 50 | jdk1.6 |
33 | 51 | jdk1.7 |
34 | 52 | jdk1.8 |
35 | 53 | jdk9 |
36 | 54 | jdk10 |
37 | 55 | jdk11 |
38 | 56 | jdk12 |
39 | 57 | jdk13 |
■查看方式2
javap -v XXX.class
javap -v HelloWorld.class
major 显示为52 (是十进制)
===
PS C:\test\myJava> javap -v HelloWorld.class Classfile /C:/test/myJava/HelloWorld.class
Last modified 2018-11-18; size 430 bytes
MD5 checksum 19f3d94a06c6349d050673c6dabd9616
Compiled from "HelloWorld.java"
class HelloWorld
minor version: 0
major version: 52
flags: ACC_SUPER
Constant pool:
#1 = Methodref #6.#15 // java/lang/Object."<init>":()V
#2 = Fieldref #16.#17 // java/lang/System.out:Ljava/io/PrintStream;
===