#JVM - Java Virtual Machine
S.G.N.
#Java Virtual Machine
This is my first article in the series #Java Simplified. My interactions with many java techies over the last few years have inspired me to write about most intricate and widely used features of Java in a simple and easy to understand yet , clearly revealing the core concepts.
Why JVM ?
JVM – Java Virtual Machine
Java has evolved drastically ever since it was first released in May 1994. Various technologies and frameworks in use today - from #JDBC to #Springboot- are all based on java language.
Many developers working in Java domain for years, still confused whether JVM -platform dependant or independent (- I know everyone’s aware java’s platform independent 😊). JVM is the core component of Java programming language which is also the key behind Java’s popularity.
Before we jump onto JVM architecture, let’s spend some time re-visiting our base concepts and deriving an answer for the above question.
Java compiler produces byte code of .java file which is nothing but .class file . This byte code is not platform dependent as class file produced for windows or Linux will be same. But execution will differ based on underlying operating system. Byte Code is an intermediate format which is only understandable by JVM .
JIT (Just in Time) together with Interpreter produces machine based execution code when we run the class file (nothing but java command) . Based on underlying operating system, JVM produces platform specific machine language code which is executed on the given platform at run time. So if we have to execute same java code on various operating systems , we need JVM specific to that operating system. This makes JVM platform dependent. JVM components – Interpreter together with JIT- converts bytecode to machine language of current operating system .
This is the reason why we have different installers for windows, Linux, Solaris etc.