Hello everyone! In this post I am going to go over the differences between the JDK, JRE, and JVM. When I first started programming in Java I had no idea what the difference between them were. I knew that I needed a copy of Java on my computer for the programs to run but that was about it. As I have spent more time with Java I understand the purpose for each component a bit better and why it is important to know the different between the three.
In the middle of the diagram above is the JVM. The java virtual machine is where the program executes. The benefit of the JVM is that when you compile java files into class files you can expect them to run anywhere that a JVM is installed. This is not the same as languages like C/C++ which compile to binary that is usable by the machine it was compiled for. The benefits of a native language is that there is no computational overhead and the program doesn’t need the JVM to run.
The java runtime environment is a set of software used to run java applications. It contains the JVM, platform core classes, and supporting libraries. The JRE and JVM combined are required to run java applications. They are intertwined and depend on each other to function.
Lastly is the java developer kit. The JDK contains development tools needed to create java applications such as compilers and debuggers. Those who only wish to run java applications would install the JRE and not the JDK.
This is just the tip of the iceberg for how java applications are developed and ran. I plan on going into each part of the JDK in depth in the future. I believe that understanding how the system works under the hood will ultimately make me a much better programmer. Anyways, that is it for today. Happy programming!
- Differences between JDK, JRE and JVM. GeeksforGeeks. (2018, August 10). https://www.geeksforgeeks.org/differences-jdk-jre-jvm/.