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

How to compile this: com.teamtreehouse.model

I have a problem in this Excessing. When I compile this code in workspace given by treehouse, it is working but Basically I practice all exercises in sublime Text. But particular this is not work in that. Please suggest me how can fix this problem? When I compile this , error message is

Karaoke.java:1: error: package com.teamtreehouse.model does not exist import com.teamtreehouse.model.Song; ^ Karaoke.java:2: error: package com.teamtreehouse.model does not exist import com.teamtreehouse.model.SongBook; ^ Karaoke.java:7: error: cannot access Song Song song = new Song( ^ bad source file: .\Song.java file does not contain class Song Please remove or make sure it appears in the correct subdirectory of the sourcepath. 3 errors

Check your imports in your java file as well as the relative paths.

1 Answer

Sarfaraj, if you copy TH classes to your own IDE you don't need the Treehouse package com.teamtreehouse.model. But you do need to comment out or delete that line of code.

Second, you must make sure that all the classes are saved to the same directory or folder, and that their file names are the same as their class names. So Song must be in a file named Song.java, etc.