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 trialDomagoj Varovic
354 PointsMain method not found in class PezDispencer, please define the main method as:
this is the error i keep getting. I did everything Craig was doing in the video but I keep getting error that the main method is not found. Is it because i did something wrong with making new PezDispencer.java in folder under Example.java?
Domagoj Varovic
354 Pointsi found out what i was doing wrong. In console i tried to load the wrong file ( I was entering PezDispenser.java, while I should enter Example.java). But now when i managet do do that correctly i keep on geeting this error: location: class Example
Example.java:4: error: cannot find symbol
PezDispenser dispenser = new PezDispenser();
^
symbol: class PezDispenser
location: class Example
2 errors
BTW how to share my workspace so you can see?
2 Answers
Steve Hunter
57,712 PointsHi there,
If the error is 'cannot find symbol' you are using a variable name that is not declared properly; probably just a spelling error.
To share the workspace, click the camera icon towards the top-right (it's the left-most of the three icons) and take a snapshot. Share the URL that it generates.
Steve.
Domagoj Varovic
354 PointsHere is my workshop. https://w.trhou.se/ixtfrr8p8c Steve, thanks for helping!
Steve Hunter
57,712 PointsIf you change the file name from PezDispencer.java
to PezDispenser.java
, it will work fine. Chance the c
to an s
.
Steve.
Domagoj Varovic
354 PointsThank you Steve u helped a lot! :)
Steve Hunter
57,712 Points
Steve Hunter
57,712 PointsSteve Hunter
57,712 PointsCan you share your Workspace so we can see your code, please?
Steve.