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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Arturo Galan](https://secure.gravatar.com/avatar/3bb82484dd80db6b9905830b20b058c8?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Arturo Galan
558 PointsWhy can't I create a new dispenser in the java-repl?
When I try to create a new dispenser in the java-repl using the command
PezDispenser pd = new PezDispenser("Yoda");
it gives me an error and the error looks like this
ERROR: cannot find symbol
symbol: class PezDispenser
location: interface Evaluation
PezDispenser method$y1r0so3qbxfcwlg4hz6p();
^
I'm not sure what this means and I've tried searching the internet with no luck. Maybe I have a syntax error somewhere, but I've scrutinized my code for a pretty long time. Please help!!!
2 Answers
![Kourosh Raeen](https://uploads.teamtreehouse.com/production/profile-photos/3971082/micro_TreehouseProfilePic.jpg)
Kourosh Raeen
23,733 PointsDid you load the java file in repl?
:load PezDispenser.java
![Arturo Galan](https://secure.gravatar.com/avatar/3bb82484dd80db6b9905830b20b058c8?s=60&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Arturo Galan
558 PointsYea but it's still giving me the error
![Craig Dennis](https://secure.gravatar.com/avatar/950c867932cc1483d8aa3dad92c4cb81?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Craig Dennis
Treehouse TeacherTry to compile it outside the REPL
javac PezDispenser.java
Do you get any syntax errors?
![Soumyadeep Mukhopadhyay](https://uploads.teamtreehouse.com/production/profile-photos/6331622/micro_11234923_1057521830958600_8615914404272023830_n.jpg)
Soumyadeep Mukhopadhyay
1,772 PointsActually the problem was with repl. The Treehouse staff Chris Ramacciotti said that in repl the :load command is unable to parse correctly if in the comments there is something called class i. e., //............ class........ then it won't compile. If you run the same code removing all comments the program will run.
![Soumyadeep Mukhopadhyay](https://uploads.teamtreehouse.com/production/profile-photos/6331622/micro_11234923_1057521830958600_8615914404272023830_n.jpg)
Soumyadeep Mukhopadhyay
1,772 PointsThere are no syntax errors when compiled as. javac PezDispenser.java
Soumyadeep Mukhopadhyay
1,772 PointsSoumyadeep Mukhopadhyay
1,772 PointsThank you for posting this question I am facing the same problem. This is not just the case with this example but with the previous one too, "PezDispenser.MAX_PEZ;" even this code shows the same error.
THANKS FOR POSTING THIS QUESTION!! AND THANKS IN ADVANCE TO WHOEVER ANSWERS THIS!!