Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Format:jimage

From ReverseEngineering.wiki
Format
Developer Oracle / OpenJDK
Versions image format 1.1
Magic DA DA FE CA on disk little-endian (0xCAFEDADA)
Extensions modules (no extension), .jimage
Endianness host endian of the build (little on x86/ARM)
License GPL-2.0 with Classpath exception
On this wiki Facts · Code · Notes · Topics

The runtime image of a Java 9+ JDK/JRE (lib/modules, also the jrt:/ filesystem): a header with magic CA FE DA DA (stored little-endian as DA DA FE CA on x86), a perfect-hash index of resource paths of the form /module/package/Name.class, and the resource bytes, optionally compressed.

Layout

From src/java.base/share/native/libjimage/imageFile.hpp: header of seven u4 values (magic, version = major<<16|minor, flags, resource count, table length, locations size, strings size), followed by the redirect table, the offsets table, the location attribute streams, the strings table, and finally the resources. The index uses a minimal perfect hash (hash multiplier 0x01000193, an FNV-style hash): redirect[hash(path, seed) % table_length] gives either a direct slot or a new seed. Lookup keys are /<module>/<package>/<base>.<extension>.

Each location is a stream of attribute records (end, module, parent, base, extension, offset, compressed size, uncompressed size, preview flags). A resource with compressed size 0 is stored raw. Compression (zip or string sharing) is applied by jlink plugins.

Identification

  • The file <JAVA_HOME>/lib/modules starts with DA DA FE CA on little-endian machines (the writer uses the build host's byte order; HotSpot also accepts the inverted magic).
  • Because the magic reads 0xCAFEDADA it is easy to confuse with the Format:Java class file magic CAFEBABE; the next fields differ (a version 1.1 here).

Extracting

The JDK ships jimage list|extract and jlink; the jrt: file system exposes the same content (jrt:/java.base/java/lang/String.class). Unverified: tool names are from general knowledge, not read from the repository for this page.

See also Format:JMOD (the build-time module container) and Format:JAR.

Code & repositories

  • https://github.com/openjdk/jdk @ 3104115c2a0587895997965c9e88a1181f52ee47 · license: GPL-2.0-only WITH Classpath-exception-2.0 (declared by the contributor for the files used; GitHub reports GPL-2.0 for the repository)
    OpenJDK: classFileParser.cpp (class parsing), classfile_constants.h.template (tags, access flags), ClassFileFormatVersion.java (major versions), libjimage/imageFile.hpp (jimage layout), JmodFile.java, JarFile.java and Attributes.java (manifest names).
    Tested on: source read, not run: Read at this commit (October 2026); files fetched, not built. · checked 2026-10-18; last activity 2026-10-18