Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Java Java Data Structures Efficiency! Building the Model

Mark VonGyer
Mark VonGyer
21,215 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,511 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 :)