java.lang.NoClassDefFoundError: MyClass (wrong name: com/foo/MyClass)

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

Do you know how to solve this issue? Write a tip to help other users and build your expert profile.

Solutions on the web

via Oracle Community by 807594, 1 year ago
myClass(wrong name: myDir/myClass)
via Oracle Community by 843829, 1 year ago
MyClass (wrong name: Classes/MyClass)
via Google Groups by erwin, 1 month ago
WCDictionary (wrong name: one/MyClass)
via Oracle Community by 843829, 1 year ago
SomeClass (wrong name: org/foo/something/SomeClass)
via Oracle Community by 843798, 1 year ago
Test (wrong name: com /Test)
via Google Groups by Albretch, 2 years ago
test00 (wrong name: com/my-name/test00)
java.lang.NoClassDefFoundError: MyClass (wrong name: com/foo/MyClass)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 2 years ago
Once, 10 months ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.