0

I was working on eclipse normally. Suddenly, when I try to run I get this error:

Error: Could not find or load main class length 

I made sure that the PATH environmental variable contains: C:\Program Files\Java\jdk1.7.0_05\bin

What is the problem please ? I viewed previous posts but nothing help in my situation.

2
  • 1
    Check if "Build Automatically" is turned off. Use a package and never name classes using lower case! Commented Aug 8, 2012 at 9:16
  • Solved but don't know the reason. The class was in a project folder marked with red exclamation mark (though it is in the workspace). I moved the code to another project and it worked. Thanks. Commented Aug 8, 2012 at 9:18

1 Answer 1

1

You are either trying to run a class which no longer exists, or not longer has a main() method or the Run configuration is incorrect.

Do you really have a class called length (all lower case) ? That would be confusing.

Sign up to request clarification or add additional context in comments.

2 Comments

Yes. It is just testing class to perform a small job.
Try doing cleaning and rebuilding your project.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.