JVM vs JRE
Java is a high-level programming language that is unique in the way that programs written on it can be executed on almost any platform. But before you can run the program on a computer, you need to install certain software; some people refer to it as JVM, while others use JRE. Although most people are referring to the same thing, there are certain differences between JVM and JRE. The JVM is actually an application that is a part of the JRE. To run an application, you need a JRE, which contains the JVM.
JVM stands for Java Virtual Machine and it creates a virtual computer that understands the code with which Java programs are written in. Java programs aren’t written in an OS specific manner. This provides it with the ability to run on any platform but requires the use of a JVM to basically translate the commands from the Java bytecode to the specific machine code.
Not everything needed by all programs are contained within the JVM. Some are located in what are called package classes. Packages like AWT,Swing, lang, and many others provide more complex capabilities to the JVM. When you combine all these supporting files along with the JVM, that is what’s called a JRE or Java Runtime Environment. In the simplest terms, the JRE is a combination of the JVM and many supporting files like packages that provide the environment from which a Java program can run.
Since an end user isn’t likely to edit or create Java applications, the JRE does not contain any files related to coding, checking, and debugging Java applications; all that is located in another Java software package. This minimizes the size of the JRE to make it easier and faster for most users to download and install the JRE. Each software platform (i.e. Windows, Linux, Mac) has its own JRE and JVM, which would only work on it and in no other. So you should be mindful in downloading a specific JRE for the OS that you have. Each JRE version would always contain its complementary JVM so there is no doubt about getting the wrong JVM.
Summary:
1.JVM is just one part of the JRE
2.JRE contains Java package classes aside from the JVM