Java 28 Features: The JDK 28 JEP List So Far (With Examples)
Java 28 features as of 3 December 2026, Rampdown Phase One day: all twelve targeted JDK 28 JEPs with their stage, runnable examples on early-access build 26, a what-changes-for-you table, and the non-JEP changes that can break an upgrade, from record constructors under preview to PKCS #12 keystores.
If you are searching for the Java 28 features, you probably want two answers: what is in the release, and what could break your code when you move to it. This page gives both. It lists every JEP targeted to JDK 28, runs an example for each one that can run on a Linux machine, and then shows the changes that have no JEP at all, which are the ones most likely to surprise a build.
JDK 28 is a six-month, non-LTS release with general availability scheduled for 9 March 2027. It carries twelve JEPs at the time of writing. The headline is value classes arriving as a preview, but the first thing that may actually bite you is smaller: turning preview features on changes how ordinary records compile.
This is the list so far, not the final list. This page was written on 3 December 2026, the day the schedule gives for Rampdown Phase One. When it was checked, openjdk.org/projects/jdk/28 (last updated 1 December) still headed the table “JEPs targeted to JDK 28, so far”, and no jdk28 stabilisation branch was visible in the openjdk/jdk repository. The rampdown date is when the list normally stops growing, but do not read this page as confirmation that it has.
Versions used. JDK 28-ea+26-2195 (early access, from jdk.java.net/28), compared against JDK 27.0.1.1+4; JDK 25.0.5.1 and 21.0.13.1 for one keystore check; OpenSSL 3.0.13; Linux x86_64, 2 vCPU container. Early-access builds change every week. Everything runnable is in the java28-features module, and run.sh regenerates every output block on this page.
JDK 28 has twelve targeted JEPs, and only some are ready for production code
A JEP (JDK Enhancement Proposal) is the document behind a sizeable change to the JDK. Being “targeted” means it is planned for a particular release. The stage matters more than the number: a final feature works with no preview or incubator switch, a preview is complete but may still change and must be switched on, and an incubator API lives in a separate module that you add by hand.
The timeline below shows where the release stands today. The point to take from it is that there are still three months between this snapshot and the finished JDK.
How to read the status column. It is copied from each JEP page. JEP 548 still said “Targeted”, although the one new API it describes is already present in build 26 (shown further down). Statuses lag or lead builds, so test the build you intend to use.
What is not in the list
If you read about a feature that is missing from the table, for example derived record creation or string templates, it is not targeted to JDK 28 according to the project page as checked here. The commented-out “proposed to target” table in the page source was empty. For the JDK 27 and 26 changes you may be arriving from, see Java 27: every JEP, plus the Java 26 changes you skipped.
Going deeper
Value classes change what == means, but only when preview is on (JEP 401)
Every ordinary Java object has an identity: two objects with the same contents are still two objects, and == can tell them apart. A value class gives that up. You declare it with the value modifier, its fields are immutable, and two instances with the same field values cannot be distinguished. That lets the JVM store them more compactly, which is a performance goal of Project Valhalla.
The diagram shows the difference on two records with identical contents.
Source: src/ValueClassDemo.java
// JEP 401: Value Objects (Preview). Run with --enable-preview on JDK 28.
value record Money(String currency, long paise) {}
record Ordinary(String currency, long paise) {}
void main() {
Money a = new Money("INR", 500);
Money b = new Money("INR", 500);
IO.println("value record a == b : " + (a == b));
IO.println("ordinary record a == b: " + (new Ordinary("INR", 500) == new Ordinary("INR", 500)));
IO.println("Money has identity : " + Objects.hasIdentity(a));
Integer x = 1996, y = 1996;
IO.println("Integer 1996 == 1996 : " + (x == y));
Object o = x; // hide the static type from javac
try {
synchronized (o) {
IO.println("locked an Integer");
}
} catch (IdentityException e) {
IO.println(e.getClass().getSimpleName() + ": " + e.getMessage());
}
}
$ java --enable-preview src/ValueClassDemo.java
value record a == b : true
ordinary record a == b: false
Money has identity : false
Integer 1996 == 1996 : true
IdentityException: Cannot synchronize on an instance of value class java.lang.Integer
The last two lines matter to code you already have. In JDK 28 with preview on, some platform classes, including Integer and LocalDate, have value-object instances (the JEP counts 30 such classes). So the same two lines of old code give a different answer depending only on a launcher flag.
Source: src/IntegerEquality.java
// The same two lines with and without --enable-preview. No new syntax, different answer.
void main() {
Integer x = 1996, y = 1996;
IO.println("x == y : " + (x == y));
IO.println("x.equals(y) : " + x.equals(y));
}
$ java src/IntegerEquality.java
x == y : false
x.equals(y) : true
$ java --enable-preview src/IntegerEquality.java
x == y : true
x.equals(y) : true
Do not start relying on the new answer. The usual advice still holds: compare with equals. The JEP says it is not trying to make == a substitute for it, and this is a preview that can change.
The surprise: ordinary records get stricter too
With preview features enabled on 28, all record classes adopt the value-class construction rules: fields must be set before this can be used. This file has no value class in it.
Source: broken/RecordThis.java
// An ordinary (identity) record. No value classes anywhere in this file.
import java.util.List;
record Node(String label, List<Node> edges) {
static void nullCheck(Object arg, Object owner) {
if (arg == null) throw new IllegalArgumentException("null arg for " + owner);
}
public Node {
nullCheck(label, this);
nullCheck(edges, this);
}
}
$ javac broken/RecordThis.java
exit 0
$ javac --enable-preview --release 28 broken/RecordThis.java
broken/RecordThis.java:10: error: reference to this may only appear after an explicit constructor invocation
nullCheck(label, this);
^
broken/RecordThis.java:11: error: reference to this may only appear after an explicit constructor invocation
nullCheck(edges, this);
^
2 errors
exit 1
So a team that enables preview only to try lazy constants can find an unrelated record no longer compiles. Validate the components themselves (do not pass this to a helper). The JEP also offers an escape hatch: an explicit super() call, with every field assigned before it.
Intermediate depth: when is == still false, and what can go wrong
For value objects == compares field values; a field that refers to an ordinary object is compared by that reference, so two value objects holding two different but equal lists are still not ==. Locking is impossible: javac rejects it when it can see the type, and the run above shows the IdentityException when it cannot. To declare your own, start with small immutable carriers such as money, coordinates or IDs. The value classes guide covers migration, flattening and benchmarks in detail.
Going deeper
Strict field initialization is the JVM guarantee underneath (JEP 539)
Normally a field you have not assigned yet reads as 0, false or null. A strictly-initialized field must be assigned before anyone can read it, so that default is never observed. It is a virtual machine feature: there is no Java keyword for it, and javac decides where to use it. This program reads the access flags of two compiled records.
Source: src/StrictFields.java
static final int ACC_STRICT_INIT = 0x0800;
value record Point(int x, int y) {}
record Plain(int x, int y) {}
public static void main(String[] args) throws Exception {
for (String name : new String[] {"StrictFields$Point", "StrictFields$Plain"}) {
var model = ClassFile.of().parse(Files.readAllBytes(Path.of(args[0], name + ".class")));
for (var field : model.fields()) {
int mask = field.flags().flagsMask();
System.out.printf("%-20s %s flags=0x%04x strictly-initialized=%b%n",
name, field.fieldName().stringValue(), mask, (mask & ACC_STRICT_INIT) != 0);
}
}
}
}
$ java --enable-preview -cp classes StrictFields classes
StrictFields$Point x flags=0x0812 strictly-initialized=true
StrictFields$Point y flags=0x0812 strictly-initialized=true
StrictFields$Plain x flags=0x0812 strictly-initialized=true
StrictFields$Plain y flags=0x0812 strictly-initialized=true
Plain is not a value record, yet its fields carry the flag as well, which is the class-file side of the record rule in the previous section. You see the source-level effect if a value class calls super() too early.
Source: broken/EarlyConstruction.java
// A value class must set its fields before the superclass constructor runs.
value class Account {
private final long id;
Account(long id) {
super();
this.id = id;
}
}
$ javac --enable-preview --release 28 broken/EarlyConstruction.java
broken/EarlyConstruction.java:6: error: strict field id is not initialized before the supertype constructor has been called
super();
^
Note: broken/EarlyConstruction.java uses preview features of Java SE 28.
Note: Recompile with -Xlint:preview for details.
1 error
exit 1
Intermediate depth: reflection and serialization
According to JEP 539, strictly-initialized final fields cannot be mutated by deep reflection, and --enable-final-field-mutation does not unlock them. Java serialization refuses (with InvalidClassException) a non-record class that declares strictly-initialized instance fields; the way out is writeReplace and readResolve. Neither was run for this page. Maintainers of agents and debuggers should also read the release note on JVM TI, JDWP and JDI changes. Background on the final-field direction: the Java 26 changes recap.
Going deeper
Structured concurrency is final: one failure now cancels the rest (JEP 543)
Suppose a request handler fetches a user and an order in parallel. With a plain executor, if the order call fails, the user call keeps running with nobody needing its result. Structured concurrency ties the subtasks to a block of code: they start inside it and are all finished when it exits. After a long run of incubator and preview rounds, JEP 543 makes the API final without further change from the JDK 27 preview.
Source: src/StructuredDemo.java
$ java src/StructuredDemo.java
both succeed:
user ok, order ok
one fails:
user was cancelled
join() threw ExecutionException: order service is down
first success wins:
mirror-A was cancelled
winner: mirror-B ok
The user call that needed two seconds reports that it was cancelled. The third scope uses a different Joiner, which is the object that decides what counts as success. The order of the two last lines can differ from run to run, because the loser is cancelled concurrently.
The same file on JDK 27 without flags does not compile.
Captured output: output/15-finals-on-jdk27.txt
$ JDK 27: java src/StructuredDemo.java (no flags)
src/StructuredDemo.java:2: error: StructuredTaskScope is a preview API and is disabled by default.
import java.util.concurrent.StructuredTaskScope.Joiner;
^
(use --enable-preview to enable preview APIs)
Code written for an older preview may not just compile. The API changed several times, including the replacement of public constructors with open() factories in JDK 25 and a new exception type parameter on join() in JDK 27. Migrating is covered in the structured concurrency deep dive.
PEM keys and certificates no longer need a library or a flag (JEP 542)
PEM is the text format that begins with -----BEGIN…. Java could always handle the binary key inside it, but you had to strip headers and Base64-decode by hand. PEMEncoder and PEMDecoder do it, including password-encrypted private keys, and JDK 28 finalises them unchanged from the third preview.
Source: src/PemDemo.java
$ java src/PemDemo.java
-----BEGIN PUBLIC KEY-----
MCowBQYDK2VwAyEA2nyOc4Zr8uZvwioD42icFwInLORdN4/VF2xQIrgpUM8=
-----END PUBLIC KEY-----
public key round trip : true
-----BEGIN ENCRYPTED PRIVATE KEY-----
private key round trip: true
The key bytes differ on each run, since a new pair is generated. According to the JEP the default password-based encryption algorithm is PBEWithHmacSHA256AndAES_128, set by the jdk.epkcs8.defaultAlgorithm security property.
Going deeper
JSON arrives in the JDK, as an incubator (JEP 540)
The JDK gains a standard way to parse and write JSON. It is deliberately small: a tree of JsonValue objects, strict RFC 8259 parsing, and no data binding. The JEP says it is not a goal to supplant established libraries such as Jackson.
Source: src/JsonDemo.java
$ java --add-modules jdk.incubator.json src/JsonDemo.java
WARNING: Using incubator modules: jdk.incubator.json
service : orders
replicas : 3
tags : [java, jdk28]
owner : (none)
missing : (absent)
JsonValueException: JsonNumber is not a JsonString. Path: "{replicas". Location: line 0, position 31.
JsonParseException: Duplicate member name: "a" was already parsed. Path: "{". Location: line 0, position 7.
{"ok":true}
Two behaviours are worth learning early. get and the as… methods fail loudly with a path to the problem, while tryGet and tryValue return an Optional for members that may be missing or null. And a document with a duplicate member name is rejected, not silently resolved.
Incubator means it can still change. The package is jdk.incubator.json and you get a warning when the module is used. Do not publish a library whose public API exposes these types.
Lazy constants and vectors are still not final (JEP 547, JEP 548)
A lazy constant holds a value that is computed the first time somebody asks for it, at most once, even if many threads ask together. JDK 28 previews it for the fourth time, with no API changes from JDK 27.
Source: src/LazyDemo.java
static final AtomicInteger CALLS = new AtomicInteger();
static final LazyConstant<String> CONFIG = LazyConstant.of(() -> {
CALLS.incrementAndGet();
return "loaded";
});
void main() throws Exception {
IO.println("before first get(), computations = " + CALLS.get());
var threads = new ArrayList<Thread>();
for (int i = 0; i < 1000; i++) {
threads.add(Thread.ofVirtual().start(() -> CONFIG.get()));
}
for (var t : threads) t.join();
IO.println(CONFIG.get() + " after 1000 concurrent get() calls, computations = " + CALLS.get());
List<String> squares = List.ofLazy(5, i -> {
IO.println(" computing element " + i);
return "sq" + (i * i);
});
IO.println("size without computing anything: " + squares.size());
IO.println(squares.get(3));
IO.println(squares.get(3));
}
$ java --enable-preview src/LazyDemo.java
before first get(), computations = 0
loaded after 1000 concurrent get() calls, computations = 1
size without computing anything: 5
computing element 3
sq9
sq9
A thousand virtual threads caused one computation, and the lazy list computed only the element that was read.
The Vector API lets you express arithmetic on many numbers at once, which the JIT compiler maps to CPU vector instructions. This is its thirteenth incubation, and it will stay one until the Valhalla preview features it needs are adopted. The one notable change is vectors of 16-bit floating point (Float16) lanes.
Source: src/Float16Demo.java
// The one change in JEP 548: vectors of 16-bit floating point lanes.
import jdk.incubator.vector.*;
void main() {
var species = Float16Vector.SPECIES_128;
IO.println(species);
}
// JEP 548: Vector API (Thirteenth Incubator). Needs --add-modules jdk.incubator.vector
import jdk.incubator.vector.*;
static final VectorSpecies<Integer> SPECIES = IntVector.SPECIES_PREFERRED;
static int sum(int[] data) {
var acc = IntVector.zero(SPECIES);
int i = 0;
for (; i < SPECIES.loopBound(data.length); i += SPECIES.length()) {
acc = acc.add(IntVector.fromArray(SPECIES, data, i));
}
int total = acc.reduceLanes(VectorOperators.ADD);
for (; i < data.length; i++) total += data[i];
return total;
}
void main() {
int[] data = java.util.stream.IntStream.rangeClosed(1, 1003).toArray();
IO.println("lanes per vector : " + SPECIES.length());
IO.println("sum 1..1003 : " + sum(data));
}
$ java --add-modules jdk.incubator.vector src/VectorDemo.java
WARNING: Using incubator modules: jdk.incubator.vector
lanes per vector : 16
sum 1..1003 : 503506
The lane count depends on the CPU. The loop handles whole vectors and then finishes the remaining elements one at a time, a pattern explained in the Vector API guide.
Going deeper
A Java program starts in the interpreter and gets fast as the JIT compiler notices what is hot. The AOT cache from earlier releases saved some of that work from a training run: loaded classes, then method profiles. JDK 28 adds the compiled native code itself. You do not change anything; the same options now put more in the file.
The workload is a small loop of streams, sorting and string joining in src/AotApp.java. The log marks AOT-compiled methods with an A in the PrintCompilation output.
Captured output: output/11-aot-code.txt
$ java -XX:AOTCacheOutput=app.aot -cp app.jar AotApp
checksum 183000
Temporary AOTConfiguration recorded: app.aot.config
Reading AOTConfiguration app.aot.config and writing AOTCache app.aot
AOTCache creation is complete: app.aot 12713984 bytes
Removed temporary AOT configuration file app.aot.config
$ java -XX:AOTMode=required -XX:AOTCache=app.aot -XX:+PrintCompilation -cp app.jar AotApp
lines with the A (AOT code) flag: 173
22 168 A 2 java.lang.Byte::toUnsignedInt (6 bytes)
22 170 A 2 java.lang.Math::floorMod (20 bytes)
22 171 A 2 java.util.ImmutableCollections$SetN::probe (56 bytes)
22 172 A 2 jdk.internal.util.ArraysSupport::vectorizedHashCode (158 bytes)
22 173 A 2 jdk.internal.util.ArraysSupport::hashCodeOfUnsigned (55 bytes)
$ same run with -XX:+UnlockDiagnosticVMOptions -XX:-AOTCodeCaching
lines with the A (AOT code) flag: 0
wall-clock milliseconds for the whole process, 15 interleaved runs each, median [min-max]
no AOT cache 447 [322-634]
AOT cache, AOT code disabled 343 [245-1049]
AOT cache with AOT code 186 [142-417]
On this program the median fell from 343 ms with the cache but AOT code switched off to 186 ms with it. That is one tiny application on a shared two-core machine with wide min-max ranges, so treat it as a direction, not a benchmark. The JEP reports that on five framework-based applications the cache cut startup by roughly 50–70% without AOT code and 65–80% with it.
The cache is tied to the machine and the collector. The JEP requires the same CPU architecture and features, and the same garbage collector, for AOT code to be loaded. A cache trained on a laptop and shipped to a different server type can lose the benefit, with only a warning in the log. -XX:AOTMode=required turns that into a startup failure, which suits a CI check.
The garbage collector changes: two for ZGC, one for Shenandoah (JEP 545, 546, 535)
A garbage collector reclaims memory, and the heap is the area it manages. Traditionally you guess a maximum size with -Xmx. JEP 546 adds an optional policy where ZGC sizes the heap itself from the application’s behaviour and the memory pressure on the machine. JEP 545 is about starting and warming up faster.
The probe program is src/HeapProbe.java.
Captured output (excerpt): output/09-zgc.txt
$ JDK 27: java -XX:+UseZGC -Xlog:gc+init HeapProbe
Large Page Support: Disabled
Min Capacity: 8M
Initial Capacity: 8M
Max Capacity: 1536M
Soft Max Capacity: 1382M
init=8M max=1536M
collector bean: ZGC Minor Cycles
collector bean: ZGC Minor Pauses
collector bean: ZGC Major Cycles
collector bean: ZGC Major Pauses
$ JDK 28: java -XX:+UseZGC -Xlog:gc+init HeapProbe
Large Page Support: Enabled (Transparent, JVM enforced)
Min Capacity: 8M
Initial Capacity: 8M
Max Capacity: 1536M
Soft Max Capacity: 1382M
Heap Sizing: Fixed
One thing did not match the JEP text on this machine. JEP 545 proposes a 2MB initial heap by default. On build 26, ZGC without -XX:+ZAdaptiveHeapSizing printed 8M on both JDK 27 and 28, and 2M only with the flag. The visible difference without the flag was large-page support going from Disabled to Enabled. Measure on your own build and hardware.
Adaptive sizing raises the default ceiling. The JEP says the default maximum becomes all of physical memory minus a small reserve, instead of 25%. Keep an explicit -Xmx if the process shares a host and you need a hard limit.
Shenandoah becomes generational by default
JEP 535 changes the default of ShenandoahGCMode from satb to generational and deprecates the old mode; choosing satb still works but prints a warning, and GC log lines and management data may differ. This was not run for this page: the jdk.java.net build used here does not support Shenandoah.
Captured output: output/10-shenandoah.txt
$ java -XX:+UseShenandoahGC -version
Error occurred during initialization of VM
Option -XX:+UseShenandoahGC not supported
exit 1
Measurements are in the generational Shenandoah benchmark article, which is a separate run.
Intermediate depth: tuning adaptive ZGC
The tuning knob the JEP describes is -XX:ZGCIntensity, a positive integer with a default of 5. Lower or higher values trade memory against GC CPU time; the relationship to actual CPU usage is intentionally unspecified. Existing sizing options keep working. Details and measurements: ZGC in JDK 28.
Going deeper
This concerns Intel Macs, not Apple silicon. Building the JDK for macOS on x64 now stops at configure unless you pass --enable-deprecated-ports, and the JEP warns there is no guarantee the port will build or work. It was not built here; the check was read in platform.m4 at tag jdk-28+26. To find affected machines in a fleet:
Source: src/PlatformCheck.java
void main() {
String os = System.getProperty("os.name");
String arch = System.getProperty("os.arch");
boolean affected = os.startsWith("Mac") && (arch.equals("x86_64") || arch.equals("amd64"));
IO.println(os + " / " + arch + " -> " + (affected ? "macOS/x64: deprecated for removal in JDK 28" : "not affected by JEP 541"));
}
The changes without a JEP are the ones that break upgrades
The release notes hold smaller changes that never appear in feature lists. These were run on JDK 27 and JDK 28 with the same source.
New PKCS #12 keystores use PBMAC1
A PKCS #12 file (.p12) is a password-protected store for keys and certificates. It carries an integrity check, and JDK 28 changes what new files use for it. Other tools have to understand that.
The commands are in run.sh.
Captured output: output/12-pkcs12-openssl.txt
$ JDK 27: keytool -genkeypair -storetype PKCS12 ... ; openssl pkcs12 -info -noout
OpenSSL 3.0.13 30 Jan 2024 (Library: OpenSSL 3.0.13 30 Jan 2024)
MAC: sha256, Iteration 10000
MAC length: 32, salt length: 20
$ JDK 28: keytool -genkeypair -storetype PKCS12 ... ; openssl pkcs12 -info -noout
OpenSSL 3.0.13 30 Jan 2024 (Library: OpenSSL 3.0.13 30 Jan 2024)
MAC: PBMAC1, Iteration 1
MAC length: 32, salt length: 8
Mac verify error: invalid password?
error:0308010C:digital envelope routines:inner_evp_generic_fetch:unsupported:../crypto/evp/evp_fetch.c:386:Global default library context, Algorithm (PBMAC1 : 0), Properties (<null>)
error:0308010C:digital envelope routines:inner_evp_generic_fetch:unsupported:../crypto/evp/evp_fetch.c:386:Global default library context, Algorithm (PBMAC1 : 0), Properties (<null>)
$ JDK 27 keytool reading the JDK 28 keystore
Keystore type: PKCS12
demo, Dec 3, 2026, PrivateKeyEntry,
$ older keytool reading the JDK 28 keystore: openjdk version "25.0.5.1" 2026-11-17 LTS
Keystore type: PKCS12
demo, Dec 3, 2026, PrivateKeyEntry,
$ older keytool reading the JDK 28 keystore: openjdk version "21.0.13.1" 2026-11-17
keytool error: java.io.IOException: Integrity check failed: java.security.NoSuchAlgorithmException: Algorithm HmacPBE1.2.840.113549.1.5.14 not available
$ JDK 28: keytool -J-Dkeystore.pkcs12.macAlgorithm=HmacPBESHA256 -genkeypair ... ; openssl pkcs12 -info -noout
MAC: sha256, Iteration 10000
MAC length: 32, salt length: 20
The last block is the workaround: set keystore.pkcs12.macAlgorithm back to HmacPBESHA256 when you create a store that an older reader must open. Newer OpenSSL releases may well read PBMAC1; only 3.0.13 was tested here.
$ JDK 27: java behaviour/Behaviour.java
-- ListFormat with single quotes in a custom pattern
[ {0}, foo ]
-- RSA/ECB/PKCS1Padding
cipher initialised
-- canonical size_t layout
j8 equals JAVA_LONG: true
-- ReflectionFactory on a non-serializable class
one-arg : Behaviour$NotSerializable()
two-arg : returned a constructor
$ JDK 28: java behaviour/Behaviour.java
-- ListFormat with single quotes in a custom pattern
[ 'bar', foo ]
-- RSA/ECB/PKCS1Padding
WARNING: An outdated Cipher algorithm has been called by Behaviour (file:behaviour/Behaviour.java)
WARNING: RSA/ECB/PKCS1Padding will be disabled by default in a future release
cipher initialised
-- canonical size_t layout
uj8 equals JAVA_LONG: false
-- ReflectionFactory on a non-serializable class
one-arg : null
two-arg : UnsupportedOperationException: Run with -Djdk.reflect.allowNonSerializableConstruction=true to temporarily re-enable this method
In order: ListFormat now treats single quotes in custom patterns literally; RSA/ECB/PKCS1Padding still works but warns; on this Linux x86_64 system the native size_t layout is now unsigned and no longer equals JAVA_LONG; and ReflectionFactory.newConstructorForSerialization, used by some serialization and mocking libraries, no longer builds instances of non-serializable classes by default (-Djdk.reflect.allowNonSerializableConstruction=true restores the previous behaviour temporarily).
$ JDK 27: javac behaviour/RawConditional.java
exit 0
$ JDK 28: javac behaviour/RawConditional.java
behaviour/RawConditional.java:5: error: incompatible types: Object cannot be converted to Integer
return (b ? parameterized : raw).get(0);
^
1 error
exit 1
$ JDK 27: javac behaviour/SwitchGuard.java
exit 0
$ JDK 28: javac behaviour/SwitchGuard.java
behaviour/SwitchGuard.java:6: error: unreported exception Exception; must be caught or declared to be thrown
case String s when check(s) -> "empty";
^
1 error
exit 1
Both are compiler bug fixes, so the old code was relying on javac being lenient. Compile your whole code base on an EA build early to find them.
Other release-note items worth a look (read, not run here)
TLS: SunJSSE adds the ML-DSA signature schemes for TLS 1.3 and places them first in the default preference list
Root certificates: some CAs are added and some removed (an Entrust G4 root and a LuxTrust global root among the removals), so check outbound TLS
keytool key pair generation now uses its own documented defaults instead of provider defaults
Desktop.browse() launching of applications is disabled by default (an opt-in property lists allowed URL schemes)
The jdk.net.useFastTcpLoopback and sun.cpu.isalist system properties are removed
Thread dumps from jcmd Thread.dump_to_file now show more, including the scope a thread is joining
Unicode 18.0 and CLDR 49 data, which can change locale-dependent behaviour
For production: probably stay on an LTS. JDK 28 is not a long-term support release. If you run JDK 25, nothing here forces a move. What is worth doing now is cheap: add a CI job that compiles and tests on a 28 early-access build, without preview flags, and report problems while the release is still stabilising.
No Comments yet!