10111
Java 24
The Key Updates You Need to Know
1
10111
Who Am I?
Oleh Melnyk
● Software Engineer @Jappware
● Java enthusiast
● Sometimes pretending to be a speaker
● Coffee lover
2
10111
󰑒 Donate & Support - we’re strong together
3
10111
🔖
Agenda
1. Current JDK state overview
2. New & Delivered features
3. Features that are in Preview/Incubating
4. Deprecations & removals
5. Predicting the future
6. Q&A
4
10111
⏳ Timeline (btw, Java turns 30 🎉)
https://blogs.oracle.com/java/post/the-arrival-of-java-24
HERE
5
10111
Let’s go! 🤘
6
10111
JEP 484: Class-File API
Finalized ✅
7
10111
ASM and JDK Version Challenge
8
10111
📁 Class-File API
● Aim is to replace the
bytecode manipulation
framework ASM
● API that evolve together with
the class-file format
● Standard API for parsing,
generating, and transforming
Java class files
9
10111
Class-File API: Small Demo 󰞵
10
10111
JEP 485: Stream Gatherers API
Finalized ✅
11
10111
Stream API
Terminal
operations
collect(Collectors.toMap(...))
count(),
anyMatch(...)
and more
Flexible enough with
Collector interface 👍
Intermediate
operations
E.g. map(...),
filter(...),
limit(...)
and more
Only limited list of built-in
☹
12
10111
Gatherer interface
Gatherer<T,A,R>
T - the type of input elements
A - the potentially mutable state type of the
gatherer operation
R - the type of output elements
Supplier<A> initializer();
● creation of a new, potentially mutable, state
Integrator<A, T, R> integrator();
● integrating a new input element to downstream
BinaryOperator<A> combiner();
● can be parallelized, merge partial result into one
BiConsumer<A, Downstream<? super R>> finisher();
● performing an optional final operation, when
there are not more elements
13
10111
Gatherer operation
14
10111
Built-in Gatherers
15
10111
More Gatherers!
tginsberg/gatherers4j jhspetersson/packrat
pivovarit/more-gatherers
16
10111
📺 Recommended 👍
https://www.youtube.com/watch?v=Up3O7UWBl8M
17
10111
JEP 475: Late Barrier
Expansion for G1
Added 🆕
18
10111
Before
G1 uses barriers to record information on accesses to the
application's memory.
19
10111
After
This change is expected to decrease C2 execution time, ensure
proper memory access ordering
20
10111
JEP 483: Ahead-of-Time Class
Loading & Linking
Added 🆕
21
10111
JVM is highly dynamic
dynamic class loading
dynamic reflection
dynamic linkage
dynamic compilation
Does a lot of work during the startup
and much more..
22
10111
AOT class loading & linking
JVM can pre-load and pre-link classes before execution, making applications start faster.
1. Run the application once in "record" mode to capture class loading information:
java -XX:AOTMode=record -XX:AOTConfiguration=app.aotconf -cp app.jar com.example.App
2. Create the AOT cache from the recorded configuration:
java -XX:AOTMode=create -XX:AOTConfiguration=app.aotconf -XX:AOTCache=app.aot -cp app.jar
3. Run the application using the AOT cache (faster startup):
java -XX:AOTMode=create -XX:AOTConfiguration=app.aotconf -XX:AOTCache=app.aot -cp app.jar
23
10111
JEP 493: Linking Run-Time
Images without JMODs
Added 🆕
24
10111
JDK structure
Run-time image JMOD files
jlink can create runtime images without JMOD files 󰚗
Such a JDK omits JMOD files, reducing its size by about 25%, while retaining the same
modules
--enable-linkable-runtime during JDK build
25
10111
JEP 491: Synchronize Virtual
Threads without Pinning
New 🆕
26
10111
Virtual threads
https://medium.com/@vchauhan76/virtual-threads-java-123e02b01b2f
Scalability Mounting/Unmounting Suitable for I/O operations
27
10111
Virtual threads pinning
Virtual Thread wouldn't release the platform
thread they were using when blocked 😢
Now Virtual Threads can acquire, hold and release
monitors, regardless of their carriers ✅
28
10111
JEP 496: Quantum-Resistant
Module-Lattice-Based Key
Encapsulation Mechanism
Added 🆕
29
10111
Module-Lattice-Based KEM
Helps to protect applications from future quantum computers
that could break RSA or Diffie-Hellman algorithms, etc.
30
10111
JEP 497: Quantum-Resistant
Module-Lattice-Based Digital
Signature Algorithm
Added 🆕
31
10111
Module-Lattice-Based Digital Signature
Algorithm
ML-DSA is designed to be secure against future
quantum computing attacks.
32
10111
JEP 478: Key Derivation
Function API (Preview)
Preview 🧪
33
10111
Key Derivation Function API (Preview)
Cryptographic algorithms for deriving additional keys from a secret key and other data
Allow security providers to implement KDF algorithms in either Java code or native code.
34
10111
JEP 487: Scoped Values (Fourth
Preview)
Preview 🧪
35
10111
ThreadLocal case
36
10111
Scoped Values (Fourth Preview)
immutable
data sharing
bounded
lifetime
smaller footprint
and complexity
37
10111
JEP 499: Structured
Concurrency (Fourth Preview)
Preview 🧪
38
10111
Independent tasks
“I want to treat multiple concurrent tasks as a single unit with
automatic lifecycle and failure management.”
39
10111
Structured approach - ShutdownOnFailure
Automatic
Cancellation
Simplified Error
Handling
Resource Management &
Observability
40
10111
Structured approach - ShutdownOnSuccess
“Try all weather providers concurrently. As soon as one returns
successfully — cancel the rest and use that result” 😎
41
10111
JEP 488: Primitive Types in
Patterns, instanceof, and switch
(Second Preview)
Preview 🧪
42
10111
Primitive types checking
43
10111
Primitive types with instanceof
44
10111
Primitive types in switch
45
10111
JEP 489: Vector API
(Ninth Incubator)
Incubating 🧪
46
10111
JEP 492: Flexible Constructor
Bodies (Third Preview)
Preview 🧪
47
10111
Validating superclass constructor arguments
48
10111
Allowed: Code before
super(...) and this(...)
● avoid writing additional methods
and constructors
● must not read any fields of the
class
● must not call any non-static
methods of the class.
● It must also not create instances
of non-static inner classes
49
10111
JEP 495: Simple Source Files
and Instance Main Methods
(Fourth Preview)
Preview 🧪
50
10111
Make single file programs simpler
51
10111
Make single file programs simpler
Simplified I/O operations.
New class java.io.IO
Automatically imports
java.base module
52
10111
JEP 494: Module Import
Declarations (Second Preview)
Preview 🧪
53
10111
Module Import Declarations
Introduce a concise way to import all packages exported by a module in Java
54
10111
Module Import Declarations
55
10111
JEP 404: Generational
Shenandoah (Experimental)
Experimental 🧪
56
10111
Generational Shenandoah (Experimental)
Generational Shenandoah GC will be able to maintain young and old generations to collect
young objects more frequently
-XX:+UnlockExperimentalVMOptions -XX:ShenandoahGCMode=generational
The goal is to make Shenandoah GC generational by default in future releases.
57
10111
JEP 450: Compact Object
Headers (Experimental)
Experimental 🧪
58
10111
Object Headers
The current object header layout is split into a mark word and a class word
The mark word comes first, has the size of a machine address, and contains:
The class word comes after the mark word. It takes one of two shapes,
depending on whether compressed class pointers are enabled:
59
10111
Compact Object Headers (Experimental)
To activate:
-XX:+UnlockExperimentalVMOptions -XX:+UseCompactObjectHeaders
Reduce the size of object headers in the HotSpot virtual machine from
96–128 bits to 64 bits on 64-bit architectures
Removing the division between the mark and class words by subsuming the class pointer, in
compressed form, into the mark word
60
10111
● JEP 479: Remove the Windows 32-bit x86 Port
● JEP 490: ZGC: Remove the Non-Generational Mode
Removals ⛔
● JEP 501: Deprecate the 32-bit x86 Port for Removal
● JEP 486: Permanently Disable the Security Manager
Deprecations❗
● JEP 472: Prepare to Restrict the Use of JNI
● JEP 498: Warn upon Use of Memory-Access Methods in
sun.misc.Unsafe
Warnings ⚠
61
10111
☕ Don't wait, try out JDK 24 now!
62
10111
🍿 Java One 2025
https://www.youtube.com/@java
63
10111
🔮 JDK 25 Predictions
● Compact Source Files and
Instance Main Methods
● Flexible Constructor Bodies
● Module Import Declarations
● Structured Concurrency (Fifth
Preview)
64
10111
⏳ Waiting…
65
10111
OMilleR_98 oleh.melnyk.98 oleh-melnyk
Demo
That’s all :)
Stay up to date!
66
10111
67

Java 24 - The Key Updates You Need to Know.pdf