Running java from command prompt
Running Java from command prompt:
Go to start->Run and type cmd.
Move to the directory which contains your Java Program.(for eg, E:/ cd java_pgm).
Set the path of JDK as "set path=%path%;D://Program Files//Java//j2sdk//bin"(j2sdk or jdk).
Compile your java program by "javac test.java".
Finally run your code "java test.java".