As the file name is HelloWorld.java we must compile it using HelloWorld.java that is javac HelloWorld.java.
The class having main method is named Helloworld (notice that w in world is small letter). In order to run we need to give the class name having main method. So we run it using class name i.e., java Helloworld.