I want to compile java but I can not [duplicate]

0

I already installed JDK, JRE, put td q had to put in the path. the javac is working but when I give the command "java HelloWorld" the following error is displayed: "Error: Could not find or load main class HelloWorld.class".

  package java;

  public class HelloWorld{
    public static void main(String[] args) {
        System.out.print("Hello World");
    }
}

The program is there.

    
asked by anonymous 15.09.2018 / 19:35

1 answer

1

Here it worked normally when removing package information:

public class HelloWorld{
    public static void main(String[] args) {
        System.out.print("Hello World");
    }
}

    
15.09.2018 / 19:43