Over a million developers have joined DZone.
Silver Partner

Java Quiz: What Does NoClassDefFoundError mean?

· Java Zone

The Java Zone is brought to you by Stormpath—offering a pre-built identity API for developers. Easily build powerful user management, authentication, and authorization into your web and mobile applications. Check out this tutorial to build a simple web app with Spring Boot and Spring Security in 15 minutes.

It took me a while to figure this out: NoClassDefFoundError is not the same as ClassNotFoundException.
  • ClassNotFoundException: The given class could not be found.
  • NoClassDefFoundError: The given class could be found, but something went wrong when initializing it (an interface it implemented could not be found, something went wrong in a static initializer etc.).

This article has more information.

From http://2ality.blogspot.com/2010/11/java-quiz-what-does-noclassdeffounderro.html

The Java Zone is brought to you by Stormpath—offering a pre-built, streamlined user management API for building web and mobile applications. Learn how token authentication with JWTs (JSON Web Tokens) helps secure websites and avoids the pitfalls of using cookies and sessions.

Topics:

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}