Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Java Data Structures Efficiency! Building the Model

Mark VonGyer
Mark VonGyer
21,239 Points

Exception in thread "main"

Exception in thread "main" java.lang.NoClassDefFoundError: com/teamtreehou se/model/Song
at Karaoke.main(Karaoke.java:7)
Caused by: java.lang.ClassNotFoundException: com.teamtreehouse.model.Song at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

Got this at the end of the progress of video.

File compiled fine, but when it went to run I got a critical error.

1 Answer

Michael Hess
Michael Hess
24,512 Points

Hi Mark,

One thing I notice is that there is a space in your package import: Exception in thread "main" java.lang.NoClassDefFoundError: com/teamtreehou se/model/Song

There is a space between the u and s of house. If you change that, you may not have the issue you're describing.

Check line 7 of Karaoke.main

Hope this helps :)