JDK or also known as the java development kit is used for developing software and is mainly installed by many developers on different platforms to help them run code and easily run java programs. Here it is certainly possible that more than one JDK version can be installed in one environment and can be switched according.
To run other software we need to have JRE or can be called Java Runtime Environment this is needed that so other software which solely depends on java can run it contains some class loaders, libraries, and JVM.
We need to keep in mind that we don't need to install this separately every time since it comes bundled with the JDK after installing.
Java Virtual Machine or JVM in short is the runtime environment to drive the code of java or other java applications. Operated by the conversion of bytecode to machine language JVM is a part of JRE which cannot be downloaded and installed.
If we need JVM we should have JRE.
JDK vs JRE vs JVM
- JDK is a development kit meant for running codes and other kinds of stuff whereas JRE is a software bundle that allows a java program to run with ease and JVM is a place/environment where it is mainly for executing bytecodes.
- JDK and JRE both are platform-dependent whereas JVM is platform-independent which means we won't be needing different JVMs for different platforms.
- JDK has the right tools for developing and debugging whereas JRE contains some of the class libraries and other files which support and all of these are not present in JVM.
- JVM is bundled in both JDK and JRE which means they both come with included JVMS whereas JDK only comes with installer whereas JRE only contains the environment to that execute the source code.