Java Programming Part 12: How to run java in a Command Line



Go to start menu, Type cmd






Type cd desktop, on my example I save my java file on the desktop that's why I added '"cd desktop

Type javac Test1.java to compile the java program, this will produce a .class file

Type 'java Test1' , then press enter. The program will appear after you hit enter

Walang komento:

Mag-post ng isang Komento