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 — AOT class preloading | java.evolved
Tooling
Advanced
AOT class preloadingCache class loading and compilation for instant startup. Code Comparison
✕ Java 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
See a problem with this code? Let us know.
Why the modern way wins
⚡
Faster startupSkip class loading, verification, and linking. 📦
Cached stateTraining run captures the ideal class state. 🔧
No code changesWorks with existing applications — just add JVM flags. Old Approach
Cold Start Every Time
Modern Approach
AOT Cache
Since JDK
25
Difficulty
Advanced
JDK Support
AOT class preloading
Available
Available as a standard feature in JDK 25 LTS (JEPs 514/515, Sept 2025). How it works
AOT class preloading caches loaded and linked classes from a training run. On subsequent starts, classes are loaded from the cache, skipping verification and linking. Combined with AOT compilation, this dramatically reduces startup time. Related Documentation
Related patterns
Tooling
Beginner
JShell for prototypingJava 8
// 1. Create Test.java // 2. javac Test.java // 3. java Test // Just to test one expression! Java 9+
$ jshell jshell> "hello".chars().count() $1 ==> 5 jshell> List.of(1,2,3).reversed() $2 ==> [3, 2, 1]
JDK 9+
→
Tooling
Beginner
Single-file executionJava 8
$ javac HelloWorld.java $ java HelloWorld // Two steps every time Java 11+
$ java HelloWorld.java // Compiles and runs in one step // Also works with shebangs: #!/usr/bin/java --source 25
JDK 11+
→
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. |