So the java source code compiled in a window's system can be run in ubuntu system or vice versa.
Different jdk's for each operating system has it's own compilers,interpreters and java virtual machine packed together as a single unit which makes it easy to run independent of the platform.
Generally when we install JDK, it installs many components. The main components are Java Compiler(javac), Java Interpreter (java), and JRE.
Overview :

JDK:
JDK = java utilities (Compiler, Interpreter etc..)+ JRE
JDK contains JRE along with many utilities like java compiler , java interpreter, applet viewer, jar achiever etc.. This provides complete set of tools to java programmer to compile, load,interpret and execute the code in a platform independent manner.
JRE:
JRE = JVM + Class loader + Class libraries
JRE is Java runtime environment which has JVM, Class loader, byte code verifier and class libraries. The compiled byte code will be given to JRE, then JRE does the following main processes.
- JRE's class loader loads the required .class files into memory
- JVM instance will be created and it executes the class files.
JVM:
JVM = Java Interpreter + jit+ Garbage Collector + threads and synchronization +..
JVM is the computing machine where, it interprets, and executes the byte code. It has a instruction set which uses memory and it handles garbage collection, synchronization and threading etc..
JIT:
JIT is a compiler inside JRE. JIT compiler compiles the byte code to the native code of operating system in which it runs and thus it increases the performance.
No comments:
Post a Comment