What is the difference between JDK and JRE?

前端 未结 20 1628
孤独总比滥情好
孤独总比滥情好 2020-11-22 03:31

What is the difference between JDK and JRE?

What are their roles and when should I use one or the other?

20条回答
  •  醉话见心
    2020-11-22 04:04

    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.

    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. JVM, JRE and JDK are platform dependent because configuration of each OS differs. But, Java is platform independent.

    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.

    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.

    (Sources: GeeksForGeeks Q&A, Java Platform Overview)

提交回复
热议问题