WORA
Before knowing how java compilation works,We have to know something called WORA - Write Once and Run Anywhere.
Java compilation works like a kind of WORA , we can write java code once and we can compile that in different platforms with JRE(java runtime environment)
Save this file as mycode.java
Javac
Javac is just a compiler for compiling java programs,It cannot execute the source code ,Its purpose is only to check and return error if any syntax error is found ,Else it compiles and produce the bytecode with the extension .class
For instance if we compile mycode.java the output will be mycode.class
For instance if we compile mycode.java the output will be mycode.class
Byte Code
After successful compilation of a java program Byte code is generated.Byte code is just a intermediate code. No platforms can understand ByteCode Only JRE can understand this ByteCode. ByteCode is common for different platforms,But JRE is different for different platforms.
JRE- Java Runtime Environment
JRE is a tool or kind of Execution Engine which execute ByteCode,It cannot understand Java Programs rather it can only understand Byte Code. Only JRE cannot compile a java program(source program) because it does not have a compiler.
Now you have a question arises in your mind "Then what is JDK" ?
Now you have a question arises in your mind "Then what is JDK" ?
JDK- Java Development Kit
JDK is a kind of kit which contains all the Tools and Essentials for the development of java application. JDK is an SDK (Software development Kit) which is specific for java applications.
JDK internally contains JRE and also many essentials
Then what is JVM ?
Java Virtual Machine is kind of specification or procedure by which JRE is developed. Sometimes JVM is also called as JVM. Oracle provides a open source platform by which anyone create their own JRE for their platform by use of JVM. It can be said that JRE is a physical implementation of JVM.
Dowload JDK8 :
Java Virtual Machine is kind of specification or procedure by which JRE is developed. Sometimes JVM is also called as JVM. Oracle provides a open source platform by which anyone create their own JRE for their platform by use of JVM. It can be said that JRE is a physical implementation of JVM.
Comments
Post a Comment