JDK-8276811 : "NoClassDefFoundError: sun/awt/SunToolkit$InfiniteLoop" after upgrade to JDK 8u301
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 8u301
  • Priority: P3
  • Status: Closed
  • Resolution: Not an Issue
  • OS: generic
  • CPU: generic
  • Submitted: 2021-11-08
  • Updated: 2021-11-15
  • Resolved: 2021-11-11
Related Reports
Relates :  
Description
After upgrade from JDK 8u291 to JDK 8u301 the sophisticated user's application cannot run successfully and fails with the next error:

"NoClassDefFoundError: sun/awt/SunToolkit$InfiniteLoop"

The application fails with this error, when it is run using JDK 8u311. It does not fail, if it is run with JDK 8u291.
Comments
Closing the issue with "Not an Issue" resolution.
10-11-2021

The issue is not a bug in JDK and should be addressed from the side of the user's application or the third-party library used by the user's application and in which the error "NoClassDefFoundError: sun/awt/SunToolkit$InfiniteLoop" occurs. The issue will not be addressed from JDK side. The issue is not a bug in JDK, because the static nested class "sun.awt.SunToolkit.InfiniteLoop", whose absence in JDK 8u301 and JDK 8u311 causes this error, is not a part of Java Platform SE 8 API Specification. Java Platform SE 8 API Specification: https://docs.oracle.com/javase/8/docs/api/index.html This class was a part of JDK internal API which could be modified or removed at any time without prior or post notification. The users of JDK are always recommended to develop applications only using JDK public API documented in Java Platform SE 8 API Specification. If the users invoke the internal API of JDK, they are running the risk of encountering issues like this at any arbitrary moment, when the application depends on the undocumented internal API which is changed or removed from JDK. Official Article on This Topic: https://www.oracle.com/java/technologies/faq-sun-packages.html The class "sun.awt.SunToolkit.InfiniteLoop" was removed from JDK 8u301 by the fix for the bug JDK-8196100 deliberately, the JDK does not depend on this class and does not need it anymore. THE RECOMMENDED SOLUTION: The user should remove any dependencies on the class "sun.awt.SunToolkit.InfiniteLoop" in the source code of their application and should recompile their application. Or if the error occurs in some third-party library used by the user's application, then this measure should be applied to that third-party library.
10-11-2021