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 Java Basics Getting Started with Java Strings and Variables

Davy T
Davy T
204 Points

Hi! I need help! How come I am getting this message? Error: Could not find or load main class Instructions

I can't seem to make the compiling work, even though I erased everything and started over. The message still doesn't want to go away... help!

Ken Alger
Ken Alger
Treehouse Teacher

Davy;

Welcome to Treehouse! Sorry you are experiencing issues.

Can you provide a little bit more information please? Are you working in workspaces, doing a challenge, or something else?

Thanks,

Ken

3 Answers

make sure u save a file first then run it by 1 . javac className.java 2 . java className

Davy T
Davy T
204 Points

Thank you!

Davy T
Davy T
204 Points

Hello! Yes I am doing the exercises in workspaces. It was in the beginning when I would make a mistake in the coding, that message would show. But even after I erased the whole thing and started over the message was still there. So I had to create a new workspaces and start over. Maybe just a bug?

solutions 1- don't forget write a class name by capital (public class -Introductions- ) first character after class is capital java it's case sensitive . 2- if you want to run an app you must write a main method after the class : ( public static void main ( String [] args) ) , without main method java compiler will not run the app . 3- then inside a main method { write what you want of code } i hope i helped you to fix your problem