Description of Java Platform
Java platform :
java platform is basically a software-based computing platform that helps the user to compile and run Java applications. This platform comprises many software tools and components that are equipped with specific functionalities.Java platform runs on a hardware-based platform.
Java platform consist of two main components :
1) JVM or Java virtual machine
2) Java API
Description of JVM is included in the description of JDK.
Figure showing java platform
Description of JRE :
JRE or Java runtime environment is responsible for the execution of java application. it provides a run time environment for java applications. It is a very important part of the Java platform and present in the Java development kit(JDK).JRE includes inbuilt packages like java.util,java.lang,etc.it includes one of the most important tools JVM(Java virtual machine) & other necessary libraries like rt.jar.
for the execution of the java application, as shown in the figure below.
JDK and its internal components
Description of JDK:
JDK or Java development kit is a software kit for developing java programs and applications.JDK is equipped with all necessary software tools which are required for developing and executing java applications. As shown in the figure we can see JDK consist of JRE and other software tools including a compiler.
So we can say JDK is everything and we have to install JDK to develop java applications.
When we write a java program in a file and save it with the .java extension it is converted to a java file. When this file is getting compiled by using the java compiler the file gets converted into a .class file. This .class file does not contain hardware native code instead of that it contains "byte codes".Byte codes are codes which can run on any hardware that means it does not bound to some particular hardware. Thus we can carry this .class file to any other system to execute the program.
Now these byte codes are applied to JVM or java virtual machine which converts these byte codes to machine level language. basically, an interpreter is present in a java virtual machine that converts byte codes to hardware-specific language.JVM has very wide usage it just not only converts byte codes but also responsible to load and verify byte codes.
As we know that java is platform-independent because byte codes can run on any platform but JVM which converts byte codes to hardware level language is platform-dependent because JVM needs to convert byte codes to hardware-specific language. So, different platforms have different JVMs or JVM varies for different platforms like Windows, Linux, Solaris, etc.
Java API :
Different java APIs are present in JRE for various functionalities. Java APIs consist of some necessary classes and interfaces including fields, methods, and constructors together in one place called packages. These inbuilt packages are used by programmers for different functionalities.
Three types of Java API's are available :
1) Official Java Core API
2) Optional Java API
3) Unofficial APIs
1) Official Java core API :
It is present in JDK. it consists of core java packages like java.io, java.util, java.lang, java.awt, etc.
2) Optional Java API :
It is not part of the official JDK. we can download it separately.
3) Unofficial APIs: These APIs are not official .means some other owner is responsible for it.
The above figure shows the flow of data from .java to hardware.
Just in time compiler :
Just in time compiler is a software tool and a part of JVM used for fast compilation. (compilation is a technique that converts one form of language to other forms). we can say it is the second compiler after the java compiler and is used for making the fast compilation.
How JIT makes compilation fast?
The compiled code(byte codes) from the java compiler is applied to JVM. We know that JIT is a part of JVM. JIT compiles parts of byte codes that have the same functionality at a particular time. thus, if the same functionality byte codes compile in quicker time then overall compilation time will be reduced. that's the reason JIT performs the fast compilation and reduces overall compilation time.
The figure shows JIT is a part of JVM
No comments:
Post a Comment