Campbell Ritchie wrote:Please indent your code correctly. You don't need the empty lines, and lines 33 and 5 should be farther to the right. It might not make much difference now, but once you get into longer classes, you can cause yourself no end of confusion if you haven't got the code indented properly.
What do you mean by a “new commend line”? Do you mean a new window opens, or simply that the display goes back to the prompt. If it means going back to the prompt, that is normal. That is what you get after invoking javac: stony silence if there aren't any error messages. That is good, but it is only half the procedure. You need to invoke the main method, which you do with the java tool. The instruction is
java HelloWorld
Note there is no extension: that bit often confuses beginners.
Thanks for the detailed post! I indeed got it working from another reply, I realize now the difference between javac and just java in cmd prompt. Everything worked like it should, but I think I'll use Eclipse to better practice java, even though there's nothing wrong with the command prompt, all guides I read have Eclipse as recommended.