Fri Jul 27 2018

JVM, JDK and JRE

Programming498 views

JVM vs JDK vs JRE

Java is a programming language expressly designed for use in the distributed environment of the Internet. Java language and computing platform first released by Sun Microsystems in 1995. It was designed to have the "look and feel" of the C++ language, but it is simpler to use than C++ and enforces an object-oriented programming model. A programmer uses it to write programs that run in a client/server configuration and over remote networks. JVM, JRE, JDK these are all the backbone of Java language. Each component works separately. It is essential for Java programmers to understand the difference between JDK, JVM, and JRE. So let's discuss what they are and how they differ from each.

What is JVM?

JVM stands for Java Virtual Machine. JVM is a Virtual Machine that provides the runtime environment to execute Java bytecode. When you write a Java program, the source code is compiled into bytecode which is understandable by the JVM. Upon execution, the JVM translates bytecode into machine code of the target operating system. JVM control execution of every Java program. It enables features such as automated exception handling, Garbage-collected heap. It is responsible for the very well-known feature of Java: cross-platform. That means you can write a Java program once and run it anywhere: Windows, Linux, Mac, and Solaris, as long as JRE is installed on the host operating system. The JVM reference implementation is developed by the OpenJDK project as open source code and includes a JIT compiler called HotSpot.

What is JDK?

JDK stands for Java Development Kit. The Java Development Kit (JDK) is an implementation of either one of the Java Platform, Standard Edition, Java Platform, Enterprise Edition, or Java Platform, Micro Edition platforms. It released by Oracle Corporation in the form of a binary product aimed at Java developers on Solaris, Linux, macOS or Windows. The JDK includes a private JVM and a few other resources to finish the development of a Java Application. It has been by far the most widely used Software Development Kit (SDK).

What is JRE?

The Java Runtime Environment (JRE) is a set of software tools for development of Java applications. It combines the Java Virtual Machine (JVM), platform core classes and supporting libraries. JRE is part of the Java Development Kit (JDK) but can be downloaded separately. JRE was originally developed by Sun Microsystems Inc., a wholly-owned subsidiary of Oracle Corporation. JRE consists of the following components -

  • Deployment technologies, including deployment, Java Web Start, and Java Plug-in.

  • User interface toolkits, including Abstract Window Toolkit (AWT), Swing, Java 2D, Accessibility, Image I/O, Print Service, Sound, drag, and drop (DnD) and input methods.

  • Integration libraries, including Interface Definition Language (IDL), Java Database Connectivity (JDBC), Java Naming and Directory Interface (JNDI), Remote Method Invocation (RMI), Remote Method Invocation Over Internet Inter-Orb Protocol (RMI-IIOP) and scripting.

  • Other base libraries, including international support, input/output (I/O), extension mechanism, Beans, Java Management Extensions (JMX), Java Native Interface (JNI), Math, Networking, Override Mechanism, Security, Serialization, and Java for XML Processing (XML JAXP).

  • Lang and util base libraries, including lang and util, management, versioning, zip, instrument, reflection, Collections, Concurrency Utilities, Java Archive (JAR), Logging, Preferences API, Ref Objects and Regular Expressions.

  • Java Virtual Machine (JVM), including Java HotSpot Client and Server Virtual Machines.

What are the differences between JDK, JRE, and JVM?

  • JVM is a Java Virtual Machine. It actually runs Java bytecode. JDK is Java Developer Kit. JDK is what you need to compile Java source code. JRE is the Java Runtime Environment. JRE is what you need to run a Java program and contains a JVM, among other things.

  • JDK is for development purpose whereas JRE is for running the java programs.

  • JDK and JRE both contain JVM so that we can run our java program.

  • JVM is the heart of Java programming language and provides platform independence.

  • The JRE does not contain tools and utilities such as compilers or debuggers for developing applets and applications. On the other hand, JDK contains tools needed to develop the Java programs.

  • The JDK is a superset of the JRE and contains everything that is in the JRE, plus tools such as the compilers and debuggers necessary for developing applets and applications.

  • JRE is targeted for execution of Java files.

  • JVM runs the program, and it uses the class libraries, and other supporting files provided in JRE.

  • JDK and JRE physically exist but JVM is an abstract machine that means it has not physically existed.

  • JRE is smaller than the JDK so it needs less disk space and it is so because JRE does not contain Java compiler and other software tools.

We use cookies to improve your experience on our site and to show you personalised advertising. Please read our cookie policy and privacy policy.