Skip to main content
395 votes
17 answers
489k views

After upgrading to JDK 21, I have the following compilation error in my Spring Boot project: Fatal error compiling: java.lang.NoSuchFieldError: Class com.sun.tools.javac.tree.JCTree$JCImport does not ...
Honza Zidek's user avatar
  • 21.8k
58 votes
10 answers
41k views

I have just upgraded from JDK 17 to 21 in my Windows machine. After that when I am running JUNIT test and I am getting the following warring. I have looked over all of the day, but no solution worked ...
Abhijit Mondal Abhi's user avatar
46 votes
7 answers
89k views

When trying to configure the project using Java 21 I'm getting the error: Unsupported Java. Your build is currently configured to use Java 21 and Gradle 8.3. Unfortunately, there is no information ...
Nolequen's user avatar
  • 4,717
29 votes
3 answers
15k views

As of 2023/JDK21, what @Nullable to use in Java? Many online materials don't even mention which import to use. So it is now (dark) history in what order those annotation appeared. I hope for general ...
Paul Verest's user avatar
  • 64.7k
22 votes
7 answers
64k views

I'm using macOS and I want to try Java 21 in IntelliJ IDEA. I believe I have done all the required steps to change Java version of a project / module. Nevertheless I still can't use new Java 21 ...
Nicolas Othmar's user avatar
21 votes
1 answer
1k views

In Java 21 and 23, java.net.InetAddress is declared public sealed class InetAddress implements Serializable permits Inet4Address, Inet6Address { However, the following code: switch (addr) { case ...
Aleksandr Dubinsky's user avatar
20 votes
1 answer
6k views

I'm using Java Corretto 21.0.0.35.1 build 21+35-LTS, and the built-in Java HTTP client to retrieve a response as an InputStream. I'm making parallel requests using virtual threads, and for the most ...
Urb's user avatar
  • 263
17 votes
1 answer
30k views

I have an issue when I am trying to use TimeUnit class from java.util.concurrent. It happens with Oracle JDK 21.0.1 (configurations are below) + IntelliJ IDEA 2023.1.5 (Community Edition) - the latest ...
pragmatic's user avatar
  • 511
15 votes
2 answers
2k views

When Java 21 introduced sequenced collections, I was really excited to start using them. But then I quickly found that there are various corners of the JDK where it seems like the new sequenced ...
Travis Furrer's user avatar
15 votes
2 answers
5k views

This is my code import java.util.Date; import java.text.DateFormat; class DateTime { public static void main(String[] args) { String dt = DateFormat.getDateTimeInstance().format(new Date()...
Spencer Shellman's user avatar
12 votes
2 answers
387 views

While upgrading our project from Java 17 to Java 21, we noticed an increase in memory consumption. After dumping the heap and analyzing the differences, I found that there are thousands of empty ...
Voy's user avatar
  • 165
10 votes
1 answer
6k views

I started to play with the new Java 21 feature - pattern matching. public class Main { public static void main(String[] args) { RecordB recordB = new RecordB(true); switch(recordB) { ...
Martin's user avatar
  • 331
9 votes
2 answers
3k views

It' s recommended by JDK developers that virtual threads should never be pooled, because they are really cheap to create and destroy. I am a little confusing about the pooling idea, since pooling ...
benrush's user avatar
  • 373
9 votes
1 answer
433 views

I noticed that the semantics of the Java Regex word-boundary matcher \b changed significantly with Java 21. Up until (at least) Java 17, it used to support Unicode, so the regex a\b.* DID NOT match ...
Victor Mataré's user avatar
8 votes
2 answers
12k views

I have just upgraded our Spring Boot applications to Java 21. As a part of that, I have also done changes to use virtual threads. Both when serving API requests and when doing async operations ...
condiorno's user avatar
  • 181

15 30 50 per page
1
2 3 4 5
21