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

Joshua Walczak
Joshua Walczak
10,854 Points

I cannot find my error, can anyone help?

This is the error I keep getting when trying to run Karaoke.java

symbol: class KaraokeMachine
location: class Karaoke
Karaoke.java:9: error: cannot find symbol
KaraokeMachine machine = new KaraokeMachine(songBook);
^
symbol: class KaraokeMachine
location: class Karaoke
3 errors

Here are the snapshots of my work space

https://w.trhou.se/a99w02r5yw

4 Answers

Yanuar Prakoso
Yanuar Prakoso
15,196 Points

Hi Joshua

From your snapshot I learned that you have mistake in naming your KaraokeMachine java file. You name it KarokeMachine.java instead of KaraokeMachine.java. Therefore when you call new KaraokeMachine() from your Karaoke class the compiler cannot find it and failed to compile it. Please rename it to KaraokeMachine.java and you will be okay.

I hope this can help a little.

This is the right answer.

Joshua Walczak
Joshua Walczak
10,854 Points

I fixed the typo and renamed the file but now i am getting this error

javac: file not found: KaraokeMachine.java
Usage: javac <options> <source files>
use -help for a list of possible options

Joshua Walczak
Joshua Walczak
10,854 Points

and now this

unreported exception IOException; must be caught or declared to be thrown

every error i fix, seems to reveal more :(

Yanuar Prakoso
Yanuar Prakoso
15,196 Points

can you give me the link to your workspace?

Joshua Walczak
Joshua Walczak
10,854 Points

i fixed it. i somehow missed a "throws IOException" after "promptAction"

thank you all for your help and insight