Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
"javap -v" - Major Version Code
How to use the major version code in the "javap" output to determine the Java version of a Java class bytecode.
✍: FYIcenter
The bytecode of each Java class has a format version code called "major version"
of 2 byres at byte offset 7.
You can convert bytecode "major version" to the version of
the Java environment where the bytecode is expected to run
using the following conversion table:
... Java 1.2 uses major version 46 Java 1.3 uses major version 47 Java 1.4 uses major version 48 Java 5 uses major version 49 Java 6 uses major version 50 Java 7 uses major version 51 Java 8 uses major version 52 Java 9 uses major version 53 Java 10 uses major version 54 Java 11 uses major version 55 Java 12 uses major version 56 Java 13 uses major version 57 Java 14 uses major version 58 Java 15 uses major version 59 Java 16 uses major version 60
If you use the verbose option "-v" or "-verbose" option of the "javap" command, this bytecode format version code will be printed output as "major version".
1. Compile HelloWorldFrame.java used in the last tutorial into a bytecode file, HelloWorldFrame.class:
> javac HelloWorldFrame.java
2. Print out its "major version" as the bytecode format version using "javap" command with the "-v" option.
> javap -v HelloWorldFrame.class | grep "major version" major version: 59
According to the conversion table, HelloWorldFrame.class bytecode is expected to run in Java 15 environment.
2021-09-09, ∼1712🔥, 0💬
Popular Posts:
JDK 11 jdk.internal.vm.ci.jmod is the JMOD file for JDK 11 Internal VM CI module. JDK 11 Internal VM...
JDK 11 jdk.jlink.jmod is the JMOD file for JDK 11 JLink tool, which can be invoked by the "jlink" co...
JDK 17 jdk.jfr.jmod is the JMOD file for JDK 17 JFR module. JDK 17 JFR module compiled class files a...
What Is poi-5.2.3.jar? poi-5.2.3.jar is one of the JAR files for Apache POI 5.2.3, which provides an...
JDK 11 jdk.aot.jmod is the JMOD file for JDK 11 Ahead-of-Time (AOT) Compiler module. JDK 11 AOT Comp...