Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
javac Name_of_Java_file
1 Javac Hello.java
java Name_of_the_class_file
1 Java Hello
Open the command prompt (cmd), to open CMD press window + R and type
cmd and type
java -version
1 C:\Users\umarkhan>java -version
2 java version "1.8.0_05"
3 Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
4 Java HotSpot(TM)64-Bit Server VM (build 25.5-b02,mixed mode)
5 C:\Users\umarkhan>
http://www.ptutorial.com/how-to-run-java-program-in-cmd 1/2
7/11/2017 How to Run Java Program in CMD - pTutorial
If you are facing problem like below shown, that means you could not set path
properly thats why windows command prompt does not know about the any tool
of java like java, javac or Javadoc. So its time to set path. Path could be
temporary or permanent. Click here to set the path in java.
Yes of course you can run java program without setting the path of jdk/bin
folder. In that case you have to save your java source file inside the jdk/bin
folder.
Programming tutorial
1,066 likes
http://www.ptutorial.com/how-to-run-java-program-in-cmd 2/2