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 Objects Creating the MVP Getting Started

Tevž Ivanjko
Tevž Ivanjko
1,774 Points

When i try to run Hangman in java i get an error: Could not find or load main class Hangman. Anyone know the solution?

I think i do the comands right because i did them a multiple times just to check. I just don't know what i do wrong i had it in the previous workspace as well but i thought it was just a bug on that one.

1 Answer

Can we see your code? And what's your class name?

Things to check are:

  1. That you class definition is public public class Hangman
  2. That its filename is Hangman.java
  3. And your main method signature is public static public static void main(String[] args)