0

I have a folder consisting some .java files. Instead of building a new java project, I run one of the .java files hellowworld.java using terminal:

java hellowworld

But it gives me could not find or load main class helloworld. What should I do?

4
  • 1
    Have you compiled the class? Commented Sep 14, 2014 at 19:29
  • Yes, it says: Class names, 'hellowworld', are only accepted if annotation processing is explicitly requested Commented Sep 14, 2014 at 19:31
  • You're missing the .java suffix in the compile command Commented Sep 14, 2014 at 19:33
  • Yes.. that's exactly what the problem is. Thank you! Commented Sep 14, 2014 at 19:39

1 Answer 1

2

Compile it first with

javac hellowworld.java

http://en.wikipedia.org/wiki/Java_compiler

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

3 Comments

It says: Class names, 'hellowworld', are only accepted if annotation processing is explicitly requested
According to this docs.oracle.com/javase/tutorial/getStarted/problems that means you forgot to put '.java' in the command.
@Meteorite If this answer helps, please click on the checkmark that you see to the left of it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.