JVM- JRE and JDK ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 29

JVM- JRE and JDK ?

Hello i am beginner in java language and i want to know what is the main difference between JVM- JRE and JDK ? and what is the role of each one ? - need a sample example please

1st Mar 2018, 2:19 PM
Youssef Ouamou
Youssef Ouamou - avatar
5 Answers
+ 27
JVM The Java Virtual machine (JVM) is the virtual machine that runs the Java bytecodes. The JVM doesn't understand Java source code, that's why you compile your *.java files to obtain *.class files that contain the bytecodes understood by the JVM. It's also the entity that allows Java to be a "portable language" (write once, run anywhere). Indeed, there are specific implementations of the JVM for different systems (Windows, Linux, MacOS, see the Wikipedia list), the aim is that with the same bytecodes they all give the same results. JDK and JRE To explain the difference between JDK and JRE, the best is to read the Oracle documentation and consult the diagram: Java Runtime Environment (JRE) The Java Runtime Environment (JRE) provides the libraries, the Java Virtual Machine, and other components to run applets and applications written in the Java programming language. In addition, two key deployment technologies are part of the JRE: Java Plug-in, which enables applets to run in popular browsers; and Java Web Start, which deploys standalone applications over a network. It is also the foundation for the technologies in the Java 2 Platform, Enterprise Edition (J2EE) for enterprise software development and deployment. The JRE does not contain tools and utilities such as compilers or debuggers for developing applets and applications. Java Development Kit (JDK) 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. Note that Oracle is not the only one to provide JDKs.
1st Mar 2018, 5:12 PM
Gami
Gami - avatar
+ 6
JDK, JRE and JVM are core concepts of Java programming language. Although they all look similar and as a programmer we don’t care about these concepts a lot, but they are different and meant for specific purposes. Java Development Kit is the core component of Java Environment and provides all the tools, executables and binaries required to compile, debug and execute a Java Program. JDK is a platform specific software and thats why we have separate installers for Windows, Mac and Unix systems. JVM is the heart of java programming language. When we run a program, JVM is responsible to converting Byte code to the machine specific code. JVM is also platform dependent and provides core java functions like memory management, garbage collection, security etc. JVM is customizable and we can use java options to customize it, for example allocating minimum and maximum memory to JVM. JRE is the implementation of JVM, it provides platform to execute java programs. JRE consists of JVM and java binaries and other classes to execute any program successfully. JRE doesn’t contain any development tools like java compiler, debugger etc. See more in detail: http://crbtech.in/Java-Training/difference-java-jdk-jre-jvm/
2nd Mar 2018, 5:27 AM
pranit patil
pranit patil - avatar
+ 3
Differences between JDK, JRE and JVM JAVA DEVELOPMENT KIT The Java Development Kit (JDK) is a software development environment used for developing Java applications and applets. It includes the Java Runtime Environment (JRE), an interpreter/loader (Java), a compiler (javac), an archiver (jar), a documentation generator (Javadoc) and other tools needed in Java development. JAVA RUNTIME ENVIRONMENT JRE stands for “Java Runtime Environment” and may also be written as “Java RTE.” The Java Runtime Environment provides the minimum requirements for executing a Java application; it consists of the Java Virtual Machine (JVM), core classes, and supporting files. JAVA VIRTUAL MACHINE It is: A specification where working of Java Virtual Machine is specified. But implementation provider is independent to choose the algorithm. Its implementation has been provided by Sun and other companies. An implementation is a computer program that meets the requirements of the JVM specification Runtime Instance Whenever you write java command on the command prompt to run the java class, an instance of JVM is created.
2nd Mar 2018, 5:18 PM
Rupesh Mishra
Rupesh Mishra - avatar
+ 3
JDK=JRE+Development Tools JRE=JVM+JAVA LAIBRARY
3rd Mar 2018, 8:09 PM
Sheikh Wasiu Al Hasib
Sheikh Wasiu Al Hasib - avatar