1, why to set classpath?
The location used to inform the JVM of the Java base Class library. Classpath tell the class loader where to find a third-party class library
You don't need to configure this variable since JDK1.5.
2. Why install two JRE (one in JDK, and one JRE in JDK sibling directory)
The JRE under the JDK is primarily for development, and a single JRE is used when the program is running
The JDK contains all the components for development, which naturally requires JRE-assisted development,
And the JRE is just the Java Runtime environment for executing. class files
Separate JRE with less server-side Java Virtual machine
The JDK is intended for developers, and the JRE is intended for users
It is necessary to include the operating environment in the developer kit.
And developers as the first user of the program, install a complete set of independent operating environment seems to have no doubt!!!
Note: As a guess, the deadline is not verified when the article is written, correct or not to be verified
If you need to refer to someone else's developed class library and get a compiled. class file (not a. Java source file), then the JRE in the JDK folder will be used at compile time.
Executing the JAVAC command in the console when compiling the source file is performed inside the JDK, regardless of the external Jer
A separate JRE (JRE in a non-JDK folder) is used when executing the Java command Execution program in the console
If there is a different understanding welcome message!! Thank you
No reprint
Zhang Yan
2017-07-27
Java environment variables about