set java path & run the program

 Install JDK

https://www.oracle.com/java/technologies/downloads/


Set JDK Path

https://www.javatpoint.com/how-to-set-path-in-java


Sample Program

public class Simple{

public static void main(String args[]){

System.out.println("hello javatpoint");

}}


Save: Simple.java


If you are saving outside JDK/BIN folder, No need to set path

if you are saving outside JDK/BIN folder, Need to set path 

set path=C:\Program Files\Java\jdk1.6.0_23\bin

Open CMD:

set path=C:\Program Files\Java\jdk1.6.0_23\bin

go to directory , where you saved the source code file


then

compile: javac Simple.java

run java program : java Simple