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!

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

Java Java Basics Getting Started with Java Introduction to Your Tools

Marius Brivinskas
Marius Brivinskas
3,277 Points

Could 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

Hi 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.


I've forked your Workspace snapshot and it works fine here.

Marius Brivinskas
Marius Brivinskas
3,277 Points

Hi Steve,

Got it sorted , when running command "java Introductions" I was adding .java at the end which was causing problem.

Thanks for response