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 trialMarius Brivinskas
3,277 PointsCould not load main method
Is it something wrong with the work space , as when I am trying to run the code I always get the error saying that "Could not find or load main class Introductions.java ".
I tried this code on IDE which is working fine.
Does anyone else faced this issue , and if so how you solved that
1 Answer
Steve Hunter
57,712 PointsHi Marius.
Have you saved and compiled your code?
Try this on the console: javac Introductions.java && java Introductions
Make sure you have saved your code, then try the above.
Let me know how you get on.
Steve.
Steve Hunter
57,712 PointsSteve Hunter
57,712 PointsI've forked your Workspace snapshot and it works fine here.
Marius Brivinskas
3,277 PointsMarius Brivinskas
3,277 PointsHi Steve,
Got it sorted , when running command "java Introductions" I was adding .java at the end which was causing problem.
Thanks for response