0xCAFEBABE – The Java Class File Magic Number

As we saw in the last post each Java class file starts with the so-called “magic” section. This has historic reasons and goes back to the very early days of the Java language. You may take a look here or here for more details about James Goslings decision.

Continue reading “0xCAFEBABE – The Java Class File Magic Number”

The Java Class File Format – an Overview

The Java Class File Format is the format in which Java classes are stored when Java source files are compiled by the Java compiler. It includes all the information from the source files as well as some optimizations, but in a format the JVM can handle.

A complete description can be found in chapter 4 of the Java Virtual Machine Specification.

Continue reading “The Java Class File Format – an Overview”

Learning the Java Class File Format

Did you ever read that ("string 1" == "string 1") == true but ("string 1" == new String("string 1")) == false? Ever came across the terms “Constant Pool“, “StackMapTable” or the “java.lang.UnsupportedClassVersionError: Unsupported major.minor version” exception?

Continue reading “Learning the Java Class File Format”