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 trialGabriel E
8,916 PointsMy Karaoke Code gives me a bunch of exception to thread main errors
Hi,
I'm working on this karaoke machine, and all of a sudden, my code stopped working. I have no idea how to post my code, because it's in about 5 files. I deleted some file...stupidly....called SongBook$1.class. The weird thing is, my machine still runs the add, play, and quit options, but when I get to choose, It wont let me choose an artist, it says like 400 cannot read "main" thread or something. As I am writing this, my Karaoke Machine now just decided it doesnt want to open at all.......More exception thread main errors......Please Help!! ;( thanks
3 Answers
Chris Howell
Python Web Development Techdegree Graduate 49,702 PointsYou will have to post the code. Near the bottom of the page where the Post Answer button is there is a Markdown Cheatsheet this shows you how to mark your text as code and such.
Place 3 backticks ( ``` ) which is below ESC or above TAB on the line above and line below your lines of code. On their own lines. Your code should sit between them.
Gabriel E
8,916 PointsI actually solved it myself just very recently. Thanks for this tips on how to post my code though!
Luis Garcia
1,552 PointsHi Chris,
I seem to be having the same issues as Gabriel. I've posted a snapshot of my workspace at https://w.trhou.se/6vhykrbgsx. Would you mind having a look at it?
Cheers, LC
Chris Howell
Python Web Development Techdegree Graduate 49,702 PointsLuis Garcia,
I will go take a look here shortly at your workspace. :)
Chris Howell
Python Web Development Techdegree Graduate 49,702 PointsWithout giving you the answer, the error is occurring on line 34 of KaraokeMachine.java
:)
Luis Garcia
1,552 PointsThanks, Chris. I was able to spot the issue.
Cheers, Luis
Luis Garcia
1,552 PointsLuis Garcia
1,552 PointsHi Gabriel,
What were these errors you were getting?
I'm finally able to compile, I got to the point where the video says "It's alright getting an error the first time the program is run if the serializable file doesn't exists" bu then I'm getting all these errors
java.io.FileNotFoundException: songs.txt (No such file or directory)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at java.io.FileInputStream.<init>(FileInputStream.java:93)
at com.teamtreehouse.model.SongBook.importFrom(SongBook.java:36)
at Karaoke.main(Karaoke.java:8)
Exception in thread "main" java.util.UnknownFormatConversionException: Conversion = 'i '
at java.util.Formatter$FormatSpecifier.conversion(Formatter.java:2691)
at java.util.Formatter$FormatSpecifier.<init>(Formatter.java:2720)
at java.util.Formatter.parse(Formatter.java:2560)
at java.util.Formatter.format(Formatter.java:2501)
at java.io.PrintStream.format(PrintStream.java:970)
at java.io.PrintStream.printf(PrintStream.java:871)
at com.teamtreehouse.KaraokeMachine.promptAction(KaraokeMachine.java:34)
at com.teamtreehouse.KaraokeMachine.run(KaraokeMachine.java:51)
at Karaoke.main(Karaoke.java:10)