java.lang.NoClassDefFoundError: Test2 (wrong name: package2/Test2)

Coderanch | nirjari patel | 3 years ago
Do you find the tips below useful? Click on the to mark them and say thanks to rafael . Or join the community to write better ones.
  1. 0
    samebug tip
    This error means there's a class missing in your classpath during runtime. You need to create a jar with all your dependencies and have it in your classpath. Check Maven Assembly Plugin and how to add your dependencies to a jar:
  2. 0

    importing package in another package is giving error

    Coderanch | 3 years ago | nirjari patel
    java.lang.NoClassDefFoundError: Test2 (wrong name: package2/Test2)
  3. 0

    How to make Eclipse include third party libraries

    Stack Overflow | 4 years ago | Gurgle528
    java.lang.NoClassDefFoundError: gSportsParser (wrong name: gSportsParser/gSportsParser)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    What is wrong with my code?Exception in thread "main" java.lang.NoClassDefFoundError: song (wrong name: Song)

    Stack Overflow | 4 years ago | user2918039
    java.lang.NoClassDefFoundError: song (wrong name: Song)
  6. 0

    Program runs in Eclipse, doesn't run at command line

    Stack Overflow | 4 years ago | user2940619
    java.lang.NoClassDefFoundError: Assignment02Q01Sec01 (wrong name: hw/Assignment02Q01Sec01)

  1. rsprangemeijer 1 times, last 5 days ago
  2. Nikolay Rybak 2 times, last 1 month ago
  3. mauritius 1 times, last 5 months ago
  4. r1chjames 2 times, last 5 months ago
  5. Kialandei 3 times, last 6 months ago
1 more registered users
85 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.NoClassDefFoundError

    Test2 (wrong name: package2/Test2)

    at java.lang.ClassLoader.defineClass1()
  2. Java RT
    1. java.lang.ClassLoader.defineClass1(Native Method)
    2. java.lang.ClassLoader.defineClass(Unknown Source)
    3. Source)
    4. Source)
    5.$100(Unknown Source)
    6.$ Source)
    7.$ Source)
    8. Method)
    9. Source)
    10. java.lang.ClassLoader.loadClass(Unknown Source)
    11. sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    12. java.lang.ClassLoader.loadClass(Unknown Source)
    13. sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
    13 frames