A DESCRIPTION OF THE PROBLEM :
Starting with Java 22, exceptions in static initializers for the main class are no longer printed, and instead the program will fail silently.
REGRESSION : Last worked in version 21.0.3
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and run code.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Expect an InternalError exception message to be printed.
ACTUAL -
Nothing is printed.
---------- BEGIN SOURCE ----------
public class StaticInitializerExceptionBug {
static {
if (true)
throw new InternalError();
}
public static void main(String[] args) {
}
}
---------- END SOURCE ----------
FREQUENCY : always