What is the difference between JVM, JDK, JRE & Ope

2019-01-03 07:14发布

What is the difference between JVM, JDK, JRE & OpenJDK?

I was programming in Java and I encountered these phrases, what are the differences between them?

18条回答
一纸荒年 Trace。
2楼-- · 2019-01-03 07:42

Another aspect worth mentioning:

JDK (java development kit)

You will need it for development purposes like the name suggest.

For example: a software company will have JDK install in their computer because they will need to develop new software which involves compiling and running their Java programs as well.

So we can say that JDK = JRE + JVM.

JRE (java run-time environment)

It's needed to run Java programs. You can't compile Java programs with it .

For example: a regular computer user who wants to run some online games then will need JRE in his system to run Java programs.

JVM (java virtual machine)

As you might know it run the bytecodes. It make Java platform independent because it executes the .class file which you get after you compile the Java program regardless of whether you compile it on Windows, Mac or Linux.

Open JDK

Well, like I said above. Now JDK is made by different company, one of them which happens to be an open source and free for public use is OpenJDK, while some others are Oracle Corporation's JRockit JDK or IBM JDK.

However they all might appear the same to general user.

Conclusion

If you are a Java programmer you will need JDK in your system and this package will include JRE and JVM as well but if you are normal user who like to play online games then you will only need JRE and this package will not have JDK in it.

In other words JDK is grandfather JRE is father and JVM is their son.

查看更多
我想做一个坏孩纸
3楼-- · 2019-01-03 07:42

In simple words :

JVM : A specification which describes the the way/resources to run a java program. Actually executes the byte code and make java platform independent. In doing so, it is different for different platform. JVM for windows cannot work as JVM for UNIX.

JRE : Implementation of JVM. (JVM + run time libraries)

JDK : JRE + java compiler and other essential tools to build a java program from scratch

查看更多
放我归山
4楼-- · 2019-01-03 07:45

JVM is the virtual machine Java code executes on

JRE is the environment (standard libraries and JVM) required to run Java applications

JDK is the JRE with developer tools and documentation

OpenJDK is an open-source version of the JDK, unlike the common JDK owned by Oracle

查看更多
我欲成王,谁敢阻挡
5楼-- · 2019-01-03 07:45

JVM

JVM (Java Virtual Machine) is an abstract machine. It is a specification that provides runtime environment in which java bytecode can be executed. JVMs are available for many hardware and software platforms.

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

查看更多
放我归山
6楼-- · 2019-01-03 07:47

JVM : this actually means the byte code interpreter .It is platform dependent. For eg: in Windows platform the 'java.exe' or 'javaw.exe' precess is the jvm process.

JDK : is a toolkit containing necessary libraries and utilities to develop and execute java program/application

JRE: is the execution environment for a java application.ie, it only support runtime dependencies including jvm for compiled program. If we want to compile a java program we need jdk.

查看更多
霸刀☆藐视天下
7楼-- · 2019-01-03 07:48

JVM is the Java Virtual Machine – it actually runs Java bytecode.

JRE is the Java Runtime Environment – it contains a JVM, among other things, and is what you need to run a Java program.

JDK is the Java Development Kit – it is the JRE, but with javac (which is what you need to compile Java source code) and other programming tools added.

OpenJDK is a specific JDK implementation.

查看更多
登录 后发表回答