Java Is a platform Independent Language, but the JDKJava Development Kit is used to developed wide range of applications. Java Development Kit includes some other like JRE and JVM for the complete development.
JREJava Runtime Environment as a Part of JDK which consists of the JVM.
JREJava Runtime Environment Provides the minimum requirement to run a java application with classes and supporting files.It also consists of Java Virtual Machine (JVM).
A Java Virtual Machine (JVM) provides specification and implementation to run any java enables to run any java program.
whenever, a javac command is triggered to run java program through command prompt the file is passed as an argument to the javac command. If the file contains any compile time error then the compilation get failed otherwise if there will not be any then if will continue the compilation, and the .class file is created. The generated class file contains the code which is easier to be executed. And after the compilation of the class file the desired output is displayed on the console.
lets take an example of java program and the commands to run in command prompt:
public static void main(String args)
command to execute are as :
c:\examples> echo %path%//Sets the path of JDK bin