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)
![Christina Vieau](https://secure.gravatar.com/avatar/f15217d37497d38cb8fe585208683e1a?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Christina Vieau
679 PointsError when trying to compile PezDispenser
My code reads the same as the teacher's so I am not sure what the trouble is. My error message reads: Error: Main method not found in class PezDispenser, please define the main method as: public static void main(String[] args) or a JavaFX application class must extend javafx.application.Application
I did try to fix my error by adding the "public static void main(String[] args)" under the class PezDispenser line and above it but I just kept getting more error messages.
I had a similar error the other day but somehow I managed to get it to run, no such luck today. Any help would be greatly appreciated! I cannot figure out how to paste the screen shot I took of my code, sorry.
Steven Parker
230,688 PointsSteven Parker
230,688 PointsScreenshots are not very useful for identifying any but the most obvious errors. But a snapshot allows full replication of your issue. Take a look at this video about sharing a snapshot of your workspace.