Error: Unable to find or load main class

Asked

Viewed 957 times

0

have tried: Unable to find or load the main file class.java

I’ve tried the system and it still works like when I use it javac arquivo javac -version java -version everything works more when I use java arquivo It works n know what’s going on and everything by cmd.

I’m starting to learn how to use java.

Code:

class main {
public static void main (String[]args){

    System.out.println("Ola mundo");




}

}

  • Where’s the code you’re trying to run? Add to question.

  • the code and simple class main { public Static void main (String[]args){ System.out.println("Hello World"); } }

  • Please click EDIT and add the full class you are trying to compile and generates this error.

  • Except for the minuscule class name, I believe the problem is the same as the two questions that Inkei. Try again by following the recommendation of the two answers, or edit this question by further detailing your problem, if possible with prints.

  • I’ve tried the one you sent more I’ve tried many of the ones you have here and in other forums

  • You have two questions, see both. If it doesn’t work, follow my recommendation from the last comment by editing the question.

  • The name of your class is main with even lower case letter? It’s not a good name, but if so, make sure it’s inside a file called main.java (lower case). Then try rotating javac main.java and finally java main. If it doesn’t work, tell me what the mistake was.

  • I did everything you said and gave it Error: Could not find or load main class main Caused by: java.lang.Classnotfoundexception: main vo try to change class name

  • worked used 'java ola'

Show 4 more comments
No answers

Browser other questions tagged

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