What is the difference between JDK and JRE?
What are their roles and when should I use one or the other?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
One difference from a debugging perspective:
To debug into Java system classes such as String and ArrayList, you need a special version of the JRE which is compiled with "debug information". The JRE included inside the JDK provides this info, but the regular JRE does not. Regular JRE does not include this info to ensure better performance.
What is debugging information? Here is a quick explanation taken from this blog post:
If you want to run Java programs, but not develop them, download the Java Run-time Environment, or JRE. If you want to develop them, download the Java Development kit, or JDK
JDK
Let's called JDK is a kit, which include what are those things need to developed and run java applications.
JDK is given as development environment for building applications, component s and applets.
JRE
It contains everything you need to run Java applications in compiled form. You don't need any libraries and other stuffs. All things you need are compiled.
JRE is can not used for development, only used for run the applications.
Jvm, Jre, Jdk these are all the backbone of java language. Each components work separately . Jdk and Jre physically exists but Jvm is an abstract machine that means it has not physically exists.
JVM is subsystem of JDK and JRE which use to check intermediate code knows as Bytecode. It first load "class file" having .c extension generated by Java compiler (Javac) through JVM subsystem classloader and classified memory location (class area, stack, heap and pc registers) according to there use. Then check all Bytecode to ensure that it is return in java and all memory accessibility access by the network. After that interpretor work start, interpretor check whole program line wise line and finally result shown in console, browser and application through JRE (Java Runtime Environment) which runtime facilities.
JRE is also a subsystem of JDK which provide runtime facilities like JVM, classes, executable file like .jar file etc.
JDK stands Java Development Kit it contain all necessary components which used in programming like class, methods, swing, AWT, package, java (interpretor), javac (compiler), appletviewer(applet application viewer) etc. So final conclusion is it content every file which useful in developing an application weather it standalone or web based.
JRE
JRE is an acronym for Java Runtime Environment.It is used to provide runtime environment.It is the implementation of JVM.It physically exists.It contains set of libraries + other files that JVM uses at runtime.
JDK
JDK is an acronym for Java Development Kit.It physically exists.It contains JRE + development tools.
Link :- http://www.javatpoint.com/difference-between-jdk-jre-and-jvm
Usually, when you only care about running Java programs on your browser or computer you will only install JRE. It's all you need. On the other hand, if you are planning to do some Java programming, you will also need JDK.
A clear understanding of these terms(JVM, JDK, JRE) are essential to grasp their usage and differences.
JVM Java Virtual Machine (JVM) is a run-time system that executes Java bytecode. The JVM is like a virtual computer that can execute a set of compiled instructions and manipulate memory locations. When a Java compiler compiles source code, it generates a highly optimized set of instructions called bytecode in a .class file. The JVM interprets these bytecode instructions and converts them to machine-specific code for execution.
JDK The Java Development Kit (JDK) is a software development environment that you can use to develop and execute Java applications. It includes the JRE and a set of programming tools, such as a Java compiler, interpreter, appletviewer, and document viewer. The JDK is implemented through the Java SE, Java EE, or Java ME platforms.
JRE The Java Runtime Environment (JRE) is a part of the JDK that includes a JVM, core classes, and several libraries that support application development. Though the JRE is available as part of the JDK, you can also download and use it separately.
For complete understanding you can see my Blog : Jdk Jre Jvm and differences
Here's a simple response directly from Oracle http://docs.oracle.com/javase/7/docs/technotes/guides/
Java SE Runtime Environment (JRE)
The JRE provides the libraries, Java virtual machine, and other components necessary for you to run applets and applications written in the Java programming language. This runtime environment can be redistributed with applications to make them free-standing.
Java SE Development Kit (JDK)
The JDK includes the JRE plus command-line development tools such as compilers and debuggers that are necessary or useful for developing applets and applications.