Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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

https://w.trhou.se/a07w63zna1

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.

Steve.

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