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 — JShell for prototyping | java.evolved
Tooling
Beginner
JShell for prototypingTry Java expressions interactively without creating files. Code Comparison
✕ Java 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]
See a problem with this code? Let us know.
Why the modern way wins
⚡
Instant feedbackType an expression, see the result immediately. 📝
No files neededNo .java files, no compilation step. 🔍
API explorationTab completion helps discover methods and parameters. Old Approach
Create File + Compile + Run
Modern Approach
jshell REPL
Since JDK
9
Difficulty
Beginner
JDK Support
JShell for prototyping
Available
Widely available since JDK 9 (Sept 2017) How it works
JShell is a Read-Eval-Print Loop for Java. Test expressions, experiment with APIs, and prototype code without creating files, compiling, or writing a main method. Tab completion and inline docs included. Related Documentation
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. |