Bytes -------------------------------------------------------------------------------------------------------------------
JRE (Java Runtime Environment) Java Runtime Environment
Includes the core class libraries required by Java Virtual Machine (JVM Java Virtual Machine) and Java programs.
JDK (Java Development Kit) Java Development Kit
JDK is provided for Java developers, including Java development tools and JRE. If JDK is installed, you do not need to use JRE.
Among them, development tools: editing tools (javac. ext) Packaging tool (jar.exe) and so on
Bytes -------------------------------------------------------------------------------------------------------------------
1. Download 2. Install 3. Configure environment variables 4. Test
Example Java_home: D: \ My \ It \ Java \ jdk1.6.0 _ 30 Path: % java_home % \ bin ;...... Classpath:.; D: \ My \ It \ Java \ classes; |
JDK Installation notes:
Try to avoid installation to a path with spaces
The JDK directory is green and can be copied directly without installation.
Differences between installation and copy: the installation will write updates to the registry, but the copies are not updated.
The role of environment variables:
Configure the environment variable path: to execute the javac command in any directory
Configure the environment variable java_home: defines a variable part of the environment variable considering directory changes.
% Java_home %: dynamically obtains the value of the environment variable java_home.
Configure the environment variable classpath: You can execute Java commands in any directory.
Temporarily configure the PATH variable:
Set: view or set Environment Variables
Set path: view the value of the path environment variable.
Set Path = Haha: temporarily set the environment variable to Haha, which is only valid in the current window.
Set Path = Haha; % PATH %: Add a new Haha value based on the original value
Set Path =: Clear Environment Variables
Start: open a new window and use temporary environment variables
Path query order:First check the current directory, and then find it under the PATH environment variable
Classpath query sequence:First query the classpath, and then find it in the current directory
Set classpath = C :\; ①
Set classpath = c: \ ②
Differences:① Add-on number. First, find it under classpath. If it cannot be found, find it under the current directory.
② No extra points, only found under classpath. An error is returned if no value is found.