Whether you are learning Java or andriod, environment variables are essential, and there are two things you need to do for an environment variable:
1. Download and install the JDK
1.1, the JDK related introduction
The importance of 1.1.1 and JDK
Mastering the JDK is the first step in learning Java, and the JDK is the core of the entire Java, including Java's runtime environment, Java's basic tools, and Java's base Class library.
A brief introduction to the basic components of 1.1.2 and JDK:
1) Important command-line tools for JDK
javac--Editor: Converts the original Java program to a byte code (that is, binary code that the computer can recognize) and simply says ". Java". ". Class" file.
java--starts the JVM and runs the. java file after the compiled file, that is, the. class file is run
jar--Packaging Tool: Package related class files into one file
javadoc--Document Generator: Extracting documents from source code (. Java) annotations
These are commonly used, but also the main command, for other commands, you can slowly learn later
2) JDK directory information
Bin folder: Executable file containing Java commands such as editor (Javac.exe), Interpreter (Java.exe), applet Viewer (Appletviewer.exe)
JRE folder: Some executable files and class libraries required by the Java runtime
Lib folder: Storing a series of class libraries
Demo folder: Examples of programs that contain some source code
Include folder: Storing some header files
1.2, the JDK download
: This Baidu is everywhere, but in the choice is best with their own computer system to match
1.3. Installation of JDK
Open the JDK installation file, you can do without the tube, directly next ... , one of the steps is to let you choose the installation path, it is best to choose the installation path you are accustomed to
1.4, the JDK environment variable matching
Method One:
Environment variables, advanced system settings, System Properties, computer---System variables: Finding environment variables
Path EDIT: Add the installation directory of the JDK's bin to the variable value (notice the semicolon before and after '; ') )
For example: JDK installation directory: D:\Program files\java\jdk1.8.0_51\bin-> OK.
To check if the installation was successful:
In the DOS Environment (CMD), enter the Java–version command, if successful, the version number of the JDK will appear, or directly enter Javac or Java, if successful, will be out of the JDK in the relevant description.
This is the simplest method.
Method Two:
System variables, advanced system settings, System Properties, computer
1) Create a new java_home variable in the system variable:
Variable name: java_home
Variable Value: The installation path of the JDK: for example: D:\Program files\java\jdk1.8.0_51 (end not semicolon ";") )
Role: Indicates the installation path of the JDK
2) in the system variable: Locate the path in the environment variable, if no new path is created:
Variable name: PATH
The value of the variable:%java_home%\bin;%java_home\jre\bin; or directly fill in the%java_home%\bin; (note the semicolon before and after ";")
Function: Allows the system to identify Java commands under any path
Specific role: To help the system operate Java, we use Javac to compile the source code into a. class file, in the call Java command to let the program execute.
3) Configure the CLASSPATH variable in the system variable: if present, add the following in, if not present, create:
Variable name: CLASSPATH
Variable value:.; %java_home%\lib\dt.jar;%java_home%\lib\tools.jar;
function: For Java load class or lib path, only the class is in Classpath, the Java command can recognize him
What it does: Tell the Java Virtual machine all executables. Class Location
4) Make sure you can
To check if the installation was successful:
In the DOS Environment (CMD), enter the Java–version command, if successful, the version number of the JDK will appear, or directly enter Javac or Java, if successful, will be out of the JDK in the relevant description.
Note: This article when only learning simple summary, will gradually improve.
Java Development Environment--JDK download and configuration of environment variables