JDK Vs .NET SDK – Nuts and Bolts
JDK
JDK (V22 as of July 2024 , Java V22) is the basic developer kit for developing and running Java applications. It includes the Java compiler (javac that compiles Java code into platform independent Java bytecode), java runtime or JRE (contains JVM, java command line runner app, javaw runner app without command line, core/base libraries), JVM or Java Virtual Machine (contains JIT compiler), JIT or Just In Time compiler (that converts java byte code to machine dependent code), ‘java’ command line app for running *.java applications, ‘javadoc’ for generating documentation and all base Java libraries such as java.lang, java,util, java.net, java.doc, java.io etc. JDK need to be installed on developer machine to be able to develop and run Java applications along with the suitable IDE such as Eclipse or Netbeans. Only JRE need to be installed if only runtime environment is needed to run the app. Below is the basic architecture of JDK –
JVM or Java Virtual Machine is an abstract computing machine that comes along with the JDK (specifically comes within the JRE component) which specifically aids in converting the Java bytecode compiled by the javac compiler, into platform/machine dependent code. It also deals with memory management and garbage collection. It has capability outside of JIT (just in time compilation) for this conversion or optionally used JIT to do this.
JRE or Java Runtime Environment is that enables the ‘running’ of java applications. It offers the JVM piece to perform the bytecode compilation into machine code, the java and javawapps to run java applications from the command line and the Java core libraries (java.io, java,util etc). JavaSE (Standard Edition) comes with JDK/JRE by default that has the support for the base libraries, while advanced libraries are available with Java EE (Enterprise Edition) with an app server such as Tomcat.
.NET SDK
.NET SDK (.NET 8 as of July 2024, C# 13) is the basic developer kit for developing and running C# applications. Like JDK, it includes the compilers for the languages (C#, VB, F# etc) that .NET ecosystem supports (csc, vbnc etc that compiles C# code into platform independent Intermediate Language – IL – code and the .NET CLR or the Common Language Runtime that contains the .NET CLI or the command line interface – dotnet- and the base class libraries. .NET CLR, like JVM in the Java world, uses JIT to convert IL into machine level code. Unlike in Java world, .NET CLR is one component as a whole and not separated into JRE=>JVM model where the actual conversion of bytecode to machine level code is confined to JVM – this separation of concern in Java world is attributed to the need to have a particular JVM version. .NET SDK need to be installed on developer machine to be able to develop and run .NET applications along with the suitable IDE such as Visual Studio or VS Code. Below is the basic architecture of .NET SDK –