GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing javaevolved.dev — Class-file parsing with the standard API | java.evolved
Tooling
Advanced
Class-file parsing with the standard APIUse the standard Class-File API for class-file parsing and transformation. Code Comparison
✕ Third-party bytecode parser
ClassReader reader = new ClassReader(
Files.readAllBytes(classFile));
reader.accept(visitor, 0);
✓ Java 24+
ClassModel model = ClassFile.of().parse(classFile);
model.methods().forEach(method ->
System.out.println(
method.methodName().stringValue()));
See a problem with this code? Let us know.
Why the modern way wins
🛡
Supported APIShips and evolves with the JDK class-file format. 📦
Fewer dependenciesHandles common bytecode tasks without an external library. 🧩
Composable modelsParsing, building, and transformation share one API. Old Approach
ASM ClassReader
Modern Approach
Class-File API
Since JDK
24
Difficulty
Advanced
JDK Support
Class-file parsing with the standard API
Available
Finalized in JDK 24 (JEP 484, March 2025). How it works
The Class-File API, finalized in JDK 24, provides supported models and transformations for JVM class files. It tracks the class-file format with the JDK and removes the need for third-party libraries in many inspection and generation tasks. Related Documentation
Proof
Related patterns
Tooling
Advanced
AOT class preloadingJava 8
// Every startup: // - Load 10,000+ classes // - Verify bytecode // - JIT compile hot paths // Startup: 2-5 seconds Java 25
// Training run:
$ java -XX:AOTCacheOutput=app.aot \
-cp app.jar com.App
// Production:
$ java -XX:AOTCache=app.aot \
-cp app.jar com.App
JDK 25+
→
Tooling
Advanced
Compact object headersJava 8
// Default: 128-bit object header // = 16 bytes overhead per object // A boolean field object = 32 bytes! // Mark word (64) + Klass pointer (64) Java 25
// -XX:+UseCompactObjectHeaders // 64-bit object header // = 8 bytes overhead per object // 50% less header memory // More objects fit in cache
JDK 25+
→
Tooling
Intermediate
Multi-file source launcherJava 8
$ javac *.java $ java Main // Must compile all files first // Need a build tool for dependencies Java 22+
$ java Main.java // Automatically finds and compiles // other source files referenced // by Main.java
JDK 22+
→
|
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |