-
Bug
-
Resolution: Fixed
-
P3
-
22, 23
ADDITIONAL SYSTEM INFORMATION :
Debian Bookworm
openjdk 22 2024-03-19
OpenJDK Runtime Environment (build 22+36-2370)
OpenJDK 64-Bit Server VM (build 22+36-2370, mixed mode, sharing)
A DESCRIPTION OF THE PROBLEM :
When an error is thrown in the static initializer I except to see an error message like I did in JDK 21, but the program silently terminates.
REGRESSION : Last worked in version 21.0.3
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile & run the example class with JDK 22
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I see an error message about an unhandled exception with my error message
ACTUAL -
The program terminates without writing anything to stdout
---------- BEGIN SOURCE ----------
public class Example {
static {
if (true) {
throw new ExceptionInInitializerError("I should see this error");
}
}
public static void main(String[] args) {
}
}
---------- END SOURCE ----------
FREQUENCY : always
Debian Bookworm
openjdk 22 2024-03-19
OpenJDK Runtime Environment (build 22+36-2370)
OpenJDK 64-Bit Server VM (build 22+36-2370, mixed mode, sharing)
A DESCRIPTION OF THE PROBLEM :
When an error is thrown in the static initializer I except to see an error message like I did in JDK 21, but the program silently terminates.
REGRESSION : Last worked in version 21.0.3
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile & run the example class with JDK 22
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I see an error message about an unhandled exception with my error message
ACTUAL -
The program terminates without writing anything to stdout
---------- BEGIN SOURCE ----------
public class Example {
static {
if (true) {
throw new ExceptionInInitializerError("I should see this error");
}
}
public static void main(String[] args) {
}
}
---------- END SOURCE ----------
FREQUENCY : always
- duplicates
-
JDK-8331229 exceptions in static initializer for main class not printed
- Closed
- relates to
-
JDK-8329581 Java launcher no longer prints a stack trace
- Resolved