java.lang.NoClassDefFoundError: Apple (wrong name: food/Apple)

tip

Look if your classpath is correct, and check if the versions of your libraries match the version you described in your pom.xml

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • package access trouble
    via by Sarah Jorden,
  • package access trouble
    via by Sarah Jorden,
  • Yet another Java classpath problem
    via Stack Overflow by pypmannetjies
    ,
  • Problems in running a modified Java code
    via Stack Overflow by user1200825
    ,
  • Setting an Application's Entry Point
    via by mathieu,
  • java runtime problems
    via by Johnny Danger,
    • java.lang.NoClassDefFoundError: Apple (wrong name: food/Apple) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$000(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

    Users with the same issue

    Unknown visitor1 times, last one,
    junior_cEngineer
    junior_cEngineer1 times, last one,
    Ghosts
    Ghosts12 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    139 more bugmates