What is the reason behind putting two jre, one in jdk and one outsite jdk in the java folder in Program files

后端 未结 4 1740
灰色年华
灰色年华 2021-01-12 08:20

I have see two jre in the java folder one in jdk and one outside jdk. Can you tell me the what is the reason behind having these two jre?

4条回答
  •  天命终不由人
    2021-01-12 08:57

    The JDK is required for developing Java applications, but it includes a JRE (Java Runtime Environment) which is required in order to run Java applications.

    If you're an advanced user and you know what you're doing then you only need one copy of the JRE, meaning that you do not need the "Public JRE" in addition to the one that comes with the JDK.

    Simply set your Environment variable JAVA_HOME to point to the JDK installation directory, and add the JRE's bin directory, i.e. %JAVA_HOME%\jre\bin, to your PATH.

    If you want Java to notify/remind/annoy you about updates, and have an extra 200MB of disk space that you don't need, then install the public JRE too.

提交回复
热议问题