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 trialSean Flanagan
33,235 PointsHow do I run this?
Hi.
I used Alt Shift F10 to run the program but I got this little dialogue box called Run with one option: Edit Configurations. What should I do next please? Thanks.
Sean
8 Answers
Seth Kroger
56,414 PointsIt sounds like you don't have a build configuration set so click the green plus sign in the upper left to add one, and select Application from the drop down. Make sure the "Main class" option is set to the class with the main() method you want to run.
Craig Dennis
Treehouse TeacherHey Sean!
The template we used originally set up a configuration, but we need to make one for this imported project. In the video I do that at about 1:46
Karaoke.java
file in the package com.teamtreehouse
on the left? Sounds like maybe it isn't. If not, maybe try re-watch the importing video.
Keep me posted.
Sean Flanagan
33,235 PointsHi Craig. Sorry for the delay due to a very busy week.
You're right, Karaoke.java isn't on the left. When you say "Importing" do you mean "Importing External Code"?
Thanks.
Sean
Sean Flanagan
33,235 PointsI'm watching the Importing video now. I noticed that in my song.java, I'd missed out the word "model" at the end of the import statement. Also, the line under @Override runs off the right of the screen so I don't know what's missing.
My song.java:
package com.teamtreehouse.model;
public class Song {
protected String mArtist;
protected String mTitle;
protected String mVideoUrl;
public Song(String artist, String title, String videoUrl) {
mArtist = artist;
mTitle = title;
mVideoUrl = videoUrl;
}
public String getTitle() {
return mTitle;
}
public String getArtist() {
return mArtist;
}
public String getVideoUrl() {
return mVideoUrl;
}
@Override
public String toString() {
return String.format("Song: %s by %s", mTitle, mArtist, mVideoUrl);
}
}
Craig Dennis
Treehouse TeacherHey Sean,
I'd start over and just follow the video if I were you. Copy the com folder by dragging and then copy the Karaoke.java file by dragging. You aren't meant to need to edit the files, and if you are, I think something is wrong.
Let me know how the restart goes! It should just work ;)
Sean Flanagan
33,235 PointsHi Craig. Thanks for getting back to me. The com.teamtreehouse folder is in the left pane inside the src folder.
Craig Dennis
Treehouse TeacherAnd just drag Karaoke.java to the root of the src folder.
Sean Flanagan
33,235 PointsI've dragged Karaoke.java to src.
Craig Dennis
Treehouse TeacherDid running it like I did in the video work now?
Sean Flanagan
33,235 PointsI ran it but it brought up my SongBook.java.
Craig Dennis
Treehouse TeacherMake sure you are in your Karaoke.java file when you choose Run...and choose Run > Run...
It will ask for configurations...I guess you have SongBook.java as Run Configuration. We go over that in a bit.
Hope it helps!
Sean Flanagan
33,235 PointsYes I do have SongBook.java as Run Configuration. When I ran Karaoke.java, I got this:
Information:Using javac 1.8.0_60 to compile java sources
Information:java: Errors occurred while compiling module 'Karaoke'
Information:23/09/2015 00:19 - Compilation completed with 14 errors and 0 warnings in 4s 11ms
C:\Users\user\IdeaProjects\Karaoke\src\com\teamtreehouse\SongBook.java
Error:(13, 18) java: cannot find symbol
symbol: class Song
location: class com.teamtreehouse.SongBook
Error:(53, 25) java: cannot find symbol
symbol: class Song
location: class com.teamtreehouse.SongBook
Error:(62, 30) java: cannot find symbol
symbol: class Song
location: class com.teamtreehouse.SongBook
Error:(79, 17) java: cannot find symbol
symbol: class Song
location: class com.teamtreehouse.SongBook
Error:(16, 32) java: cannot find symbol
symbol: class Song
location: class com.teamtreehouse.SongBook
Error:(24, 18) java: cannot find symbol
symbol: class Song
location: class com.teamtreehouse.SongBook
Error:(45, 29) java: cannot find symbol
symbol: class Song
location: class com.teamtreehouse.SongBook
Error:(63, 26) java: cannot find symbol
symbol: class Song
location: class com.teamtreehouse.SongBook
Error:(64, 14) java: cannot find symbol
symbol: class Song
location: class com.teamtreehouse.SongBook
Error:(65, 18) java: cannot find symbol
symbol: class Song
location: class com.teamtreehouse.SongBook
Error:(80, 14) java: cannot find symbol
symbol: class Song
location: class com.teamtreehouse.SongBook
Error:(81, 35) java: cannot find symbol
symbol: class Song
location: class com.teamtreehouse.SongBook
Error:(84, 32) java: cannot find symbol
symbol: class Song
Error:(84, 44) java: cannot find symbol
symbol: class Song
Craig Dennis
Treehouse TeacherSean can you just delete the project and start over? This is a new bug that I assume got introduced by moving things around.
It just works when you copy things correctly. I feel like you are spending way too much time here trying to fix this, and I'm sorry about that.
Let's just start over, should not be difficult at all.
Fingers crossed it goes better next time!
Sean Flanagan
33,235 PointsOkay thanks.
Sean Flanagan
33,235 PointsSean Flanagan
33,235 PointsHi Seth.
As far as the video is concerned, I've watched up to 1 minute 36 seconds. I got as far as the "Run - Unnamed" dialogue box.
Here's my Karaoke.java syntax:
Here are the results I got from running Karaoke.java (if that's the correct file):
Am I doing this right so far?
Thanks. :-)