Java 27 and 26: runnable demos and captured output for every JEP, plus version lanes

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01B38FGKKam5SCGgwgduVAh3
This commit is contained in:
2026-09-21 15:08:50 +00:00
committed by Claude
co-authored by Claude Sonnet 5
commit f59c1de96d
152 changed files with 5049 additions and 0 deletions
+49
View File
@@ -0,0 +1,49 @@
# sun.misc.Unsafe memory access (JEP 498) and JNI (JEP 472): what does the JVM say?
$ java UnsafeWarning (JDK 21)
java.version = 21.0.12.1
read back: 42
$ java UnsafeWarning (JDK 25)
java.version = 25.0.4.1
WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::allocateMemory has been called by UnsafeWarning (file:<repo>/build/lanes/us25/)
WARNING: Please consider reporting this to the maintainers of class UnsafeWarning
WARNING: sun.misc.Unsafe::allocateMemory will be removed in a future release
read back: 42
$ java UnsafeWarning (JDK 24, Corretto image)
java.version = 24.0.2
WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::allocateMemory has been called by UnsafeWarning (file:/b/us21/)
WARNING: Please consider reporting this to the maintainers of class UnsafeWarning
WARNING: sun.misc.Unsafe::allocateMemory will be removed in a future release
read back: 42
$ java JniWarning (JDK 21)
java.version = 21.0.12.1
System.loadLibrary("net") returned
$ java --enable-native-access=ALL-UNNAMED JniWarning (JDK 21)
java.version = 21.0.12.1
System.loadLibrary("net") returned
$ java JniWarning (JDK 25)
java.version = 25.0.4.1
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::loadLibrary has been called by JniWarning in an unnamed module (file:<repo>/build/lanes/jni25/)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled
System.loadLibrary("net") returned
$ java --enable-native-access=ALL-UNNAMED JniWarning (JDK 25)
java.version = 25.0.4.1
System.loadLibrary("net") returned
$ java JniWarning (JDK 24, Corretto image)
java.version = 24.0.2
System.loadLibrary("net") returned
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::loadLibrary has been called by JniWarning in an unnamed module (file:/b/jni21/)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled