Key Components of JAVA – User friendly Tech help

JDK, JRE and JVM are core concepts of Java programming language. As a novice in this language we should try to comprehend these concepts to visualize how it works logically.
n
nFor more updates do follow us on Facebook,Twitter or Google+
n
n
n
Java Development Kit (JDK) consists of tools needed to create the Java programs,like Java libraries, Java compiler(javac.exe), Java debuggers, bundling and deployment tools.It also contains the JRE to run the java programs.We need to install the platform specific JDK like for windows,linux.We did installed the JDK while understanding the prerequisites for Selenium.
n
nIn nutshell JDK,is required to create our own java programs and to compile them as bytecode.Further we need JRE only for running the programs.
n
nJavac:- Meaning Java Compiler,which takes programming code(java) as input and produces an executable code(bytecode) as an output.This is further executed by JVM into native code (machine code) as per the platform(windows,linux,mac,solaris)
n
nByteCode:-It is stored in .class file and cannot be read by standard CPU’s and needs to be translated into an instruction language that the underlying execution platform(Windows,linux) can comprehend.
n
nJRE:-
nwe must have experienced this thing that while trying to run any  java application on browser or in mobile,browser often suggest to download the JRE to run the program.
n
nThus JRE is targeted for execution of Java files i.e. JRE = JVM + Java Packages Classes( like math, lang, awt,swing etc)+runtime libraries. Java code comes in the bundled form of JAR  (Java archive) files(remember we also used selenium JAR files to create test scripts)and we require Java virtual machine JVM to execute it.JRE is again platform dependent like JDK
n
nJVM:-
nJAVA virtual machine is the key for converting byte code into machine specific code.Moreover we have multifarious JVM as per the operating system like for Windows, Linux or Mac but one JAR(byteCode) can run on all these operating systems. 
n
nJava Virtual machine is at heart of Java programming language and provide several features  to Java programmer including Memory Management and Garbage Collection, Security and other system level services.
n
nJVM is the backbone of the “write once and run everywhere” principle in JAVAn

Summary:-
n1)  Both JDK and JRE come as installer while JVM are bundled with them.
n2)  JRE only contain environment to execute java program but doesn’t contain other tool for compiling java program like JDK. In short JDK is for development purpose whereas JRE is for running of java programs.If we only need to run the Java code then JRE is recommended option but for full fledge development package JDK is preferred option.
n3) JVM comes along with both JDK and JRE , it is like heart of java programming language and provides platform independence.
n
nNote:-
n1)JIT (Just in Time) or dynamic compilation is part of JVM that optimizes bytecode to machine specific language compilation.
nWhat happens is:- An JVM interpreter generates and executes the machine code instructions on the fly for each instruction, regardless of whether it has previously been executed.Now JIT caches the instructions that have been previously been interpreted to machine code, and reuses those native machine code instruction thus saving time and resources by not having to re-interpret statements that have already been interpreted by compiling similar bytecodes at same time, hence reducing overall time taken for compilation of bytecode to machine specific language.
n
n2)Eclipse IDE comes with its own java compiler , it is different from javac, like it allows to run the code that did not actually properly compile and incase the error code block is never ran, our program would run fine.Further it comes with incremental feature, which allows our code to be pre-compiled as soon as we are finish typing.
n
nIntroduction to JAVA
nDataType in Java

Was this article helpful?
YesNo

Similar Posts