Why is it prompted to install jre during JDK installation?

Is there any difference between the jre in the JDK package and the jre installed separately?

一样的。
https://stackoverflow.com/questions/2541319/jre-included-with-jdk-vs-standalone-jre

Why does JRE need to be installed when JDK is installed?

In fact, you can not install it.
The two jres are for sharing the work.
If the user just executes the java program, then the jre environment is enough.
If the user is a developer and needs to compile and run, the system will look for the parent path (environment variable) containing java, javac and other commands, that is, jre under jdk.
In this way, when running an external program, it is looking for jre; when developing a program, it is looking for jre under jdk.

Java | Why do you need two JREs when installing the environment

The newly installed jre does not manually configure environment variables, how is it recognized?

Environment variables are automatically generatedC:\Program Files (x86)\Common Files\Oracle\Java\javapath

Guess you like

Origin blog.csdn.net/zhangjin1120/article/details/128271833