Error: Unable to locate or load Olamundo main class.java

Asked

Viewed 1,059 times

-3

I’m trying to compile and run a "hello world" in Java from the command line.

My code is:

public class OlaMundo{
  public static void main(String[] args){
    System.out.println("Oi , funcionou");
  }
}

I’m trying to get around the command line like this

$> java OlaMundo.java

This error is being shown

Error: Unable to locate or load Olamundo main class.java

  • 1

    Although you can understand the question, always try to write about the problem so the question is well evaluated. Something like: "When I try to run the Olamundo program with the command below, the following error occurs:".

1 answer

0

You must first compile with the command javac:

javac OlaMundo.java

And then run with the command java:

java OlaMundo

  • 1

    Good morning ,I did it and it didn’t work

  • @Miscellaneous footballers appears some error?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.