3-JDK
JAVAC (JAVA COMPILER)
It checks the given program to find syntax mistakes. The java compiler generates .class file(byte code) from *.java file, if there are no syntax errors in the program.
- If there is any syntax mistakes then java compiler throws an error. The errors which is throw by javac are called as Compile Time Errors or Checked Exceptions.
Java Virtual machine (JVM)
- The Java Virtual machine (JVM) is the virtual machine that interprets the byte code into the machine code depending upon the underlying operating system and hardware combination. The JVM doesn’t understand Java source code, that’s why you compile your .java files to obtain .class files that contain the bytecodes understood by the JVM.
- If JVM is not able to understand a line of code then JVM throws an error at runtime called as Runtime errors Or Unchecked Exceptions.
Java Runtime Environment (JRE)
- It is used to setup the environment to run java programs.
i.e. JRE = JVM + Java Packages Classes(like util, math, lang, awt,swing etc)+runtime libraries.
JDK
Java Development Kit (JDK) is a software development environment used for developing Java applications. It contains java compiler, jvm and other necessary files which are required to compile and executes java programs. JDK is platform dependent.
JDK = JAVAC + JRE