Zero-basic learning java (1): Build the Java environment and build java
I. Determine what JDK is and JRE
(1) JDK (JavaDevelopment Kit Java Development Kit)
JDK is provided for Java developers, including java development tools and JRE. Therefore, if JDK is installed, you do not need to install JRE separately.
Development tools: compilation tool (javac.exe packaging tool (jar.exe) and so on
(2) JRE (Java Runtime Environment)
Including the core class libraries required by Java Virtual Machine (JVM Java Virtual Machine) and Java programs. To run a developed Java program, you only need to install JRE on the computer.
In short, it is to use JDK development tools to complete the java program and hand it to JRE for running.
Ii. Download and install JDK
Official Website:
Www.oracle.com
Java.sun.com
Install JDK:
Installation in a silly way. Next step.
Suggestion: do not include Chinese characters or special characters such as spaces in the installation path.
If you are prompted to install JRE, you can choose not to install it.
3. Configure the environment variable path
1. Input javac in the doscommand line and an error message is displayed:
Cause of error: if the program currently executed does not exist in the current directory, windows will find it in the directory specified by an environment variable named path in the system. If not found, the above error message is displayed. So go to the jdk installation path \ bin directory and run javac. The javac parameter prompt is displayed.
2. Configure the environment variable path
Every time a java tool is executed, it is very troublesome to enter the bin directory. Can I execute java tools in any directory?
Based on the principle of finding executable programs in windows, you can define the path of the java tool to the path environment variable, and let the system help us find the program to run.
3. configuration method:
My computer -- properties -- Advanced System settings -- Environment Variables
Edit the path environment variable, add the directory where the java tool is located at the beginning of the variable value, and separate it with ";" and other values.
Open the doscommand line and input javac in any directory. If the javac parameter information is displayed, the configuration is successful.
Shang xuexiang opened the door of java and added the code 858568103. For more information, please wait.