What is the reason for placing two jre, one in jdk and one outsite jdk in the java folder in the program files

I see two jre in java folder, one in jdk and one external jdk. Can you tell me what is the reason that these two jre?

+6
source share
4 answers

If you just run the application, you only need the Java Runtime Environment (JRE), so it makes sense to deliver this as a separate object.

If you are developing, you need the full Java Development Kit, and it’s useful to have everything you need, including a JRE.

So, two use cases, two ways to get a JRE.

See the question Jaya refers to for more information.

+2
source

I did not read your answer correctly and searched a bit, here is the answer from someone who seems to be Oracle staff:

There are some differences that may explain what you see. The JRE included in the JDK does not support automatic updates, and it does not contain product offers, as does a separate JRE. JRE and JDK are created simultaneously (approximately) from the source database.

from https://forums.oracle.com/forums/thread.jspa?threadID=2277801


Old 32/64 bit Windows answer

If you are using the 64-bit version of Windows 7 (or possibly other MS 64-bit systems), you need 2 JREs. One for your 64-bit applications (Browser) and one for 32 bits. They must have different folder names, that is: 64 bit C: \ Program Files \ java \ jre7 32 bit C: \ Program Files (x86) \ java \ jre7

+4
source

If you are developing a java program, then private jre (C: \ Program Files \ Java \ jdk1.7.0_65 \ jre) and public jre runtime (C: \ Program Files \ Java \ jre7) will be used. This is the default use case. If the compilation time of jvm detects that private jre does not exist, then it will work for public jre and runtime, if jvm detects that if public jre is not there, then it will go to private jre.

+1
source

The JDK is required to develop Java applications, but includes the JRE (Java Runtime Environment), which is required to run Java applications.

If you are an advanced user and know what you are doing, you only need one copy of the JRE, which means that you do not need a "Public JRE" in addition to the one that comes with the JDK.

Just set the JAVA_HOME environment variable to specify the JDK installation directory, and add the JRE bin , i.e. %JAVA_HOME%\jre\bin to your PATH .

If you want Java to notify / remind / annoy you of updates and have an additional 200 MB of disk space that you don’t need, install a public JRE as well.

0
source

Source: https://habr.com/ru/post/909155/


All Articles