ClassNotFoundException or NoClassDefFoundError occured after migrating between different versions of JDK or different implementations of JDK (Oracle JDK and OpenJDK, etc)

Solution Verified - Updated -

Issue

  • ClassNotFoundException or NoClassDefFoundError occurred after migrating between different versions of JDK or different implementations of JDK (Oracle JDK and OpenJDK, etc).
  • ClassNotFoundException or NoClassDefFoundError is thrown due to lack of classes in the packages like sun.* and com.sun.*, which are not standard API.

Environment

  • Red Hat build of OpenJDK
  • Oracle JDK

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content