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

Java

IntelliJ Compiler/Executor is broken, and I get the same Error: Cannot find or load main class Main.

IntelliJ IDE has been said to be one of the most useful and user-friendly Development Software Applications for Java. It ain't working out too well right now...

I'm trying to create a simple "Hello World" project just to see how this keeps happening, but regardless of what I do, I get the same error every time.

Error: Could not find or load main class sample.Main I've been researching for a fix for this for days and hours today, and I'm VERY mad that I can't find anything on how to fix it. I've already tried reinstalling the JDK and IntelliJ, and I'm not using any external software. I simply want to make a program and test it using IntelliJ's VM, but it keeps throwing the same error every time. I've tried remaking the Manifest file, exporting it to a JAR works perfectly and I am able to run the JAR file, I am able to compile the project externally using my local Terminal, but IntelliJ refuses to be cooperative. Please help me fix this; it's VERY frustrating.

Hi Nick

I fully understand you, I also had a lot of problems with IntelliJ in the beginning an used the BlueJ IDE for a quite long time. But as soon as it's running its super awesome.

Have you already selected the main class?

I have referenced the main class in multiple occasions. Like I said above, creating a JAR file runs completely fine, and compiling using my local Terminal does the same. I've edited run configurations and set the path to the Main class, and have even created a manifest that does the same. Unfortunately, none of these methods are working in my liking, or at all.