Main content
The full name of the JDK is the Java SE Development Kit, the Java Standard Development package, a development package for Java applications that is available on the Java website. The JDK provides a variety of tools (such as Java compilers, Java virtual machines, etc.) and resources needed to develop Java programs, as well as Java runtime environments that run Java programs.
Download, install, and set environment variables for JDK
1. Log in to the Java website:
http://www.oracle.com/technetwork/java/index.htm, select "Downloads/java SE" and select "Java Platform (JDK) 8u91/8u92" in the new page to download the JDK , select "Accept License agreement" in the new page and select the JDK installer download on the appropriate host platform.
2. Download JDK8. You will need to register your Oracle account during the download process.
3. Install the JDK8. Explains the meaning of the installation option.
4. Set environment variables.
Configure environment variables using Control Panel: Control Panel \ System and Security \ System, select Advanced system settings from the options list on the left, open the System Properties dialog box, select Environment variables in the Advanced tab, and set system environment variables in the Environment Variables dialog box that pops up.
Configure Java_home, Path, CLASSPATH.
5. Test the installation and configuration.
To open the Start menu, click the Start button in the lower-left corner of your screen.
At the bottom of the left pane is the search box, where you can find programs and files on your computer by typing search items.
In the Search box, type command: CMD, and then press the "Enter" key to open a command prompt window.
In the Command Prompt window, enter:
Set then enter to see if the environment variable is set up properly.
Javac then enter, according to the results to determine whether the installation, configuration is normal.
Some concepts in installing JDK and configuring environment variables
(1) Environment variables
Environment variables (environment Variables) are variables that are used in the operating system to specify some parameters of the operating system's environment, such as temporary folder locations and System folder locations.
Environment variables are equivalent to some of the parameters that are set up for a system or user application, which is of course related to the specific environment variables. For example, path, is to tell the system, when the system is required to run a program without telling it the full path of the program, in addition to the current directory in the search for this program, but also to find out which directories to go down, such as TC or VC + +, set include=path1;path2; is to tell the compiler where to find the. h type of file; Of course not just specifying what path, but also other functions, such as set DIRCMD=/4 setting an environment variable is used when using the dir command to add/4 as the default parameter after your dir command, Just like your every command adds the/4 parameter, which is actually an environment variable set for command interpreter commands, and is set for the internal command of Dir.
(2) Environment variables for JDK
Path : sets the JDK command search path. Tell the operating system that when the tool program that is being run by the JDK is not in the current directory, go to the path contained in paths to find the appropriate program.
Java_home: Sets the installation path for the JDK.
classpaht: to tell the Java execution Environment, in which directories you can find the classes or packages that you need to execute the Java program. The JVM and other JDK tools find classes by searching the Platform libraries, library extensions, and classpath in turn. When we compile or execute Java programs may encounter a similar "Java.lang.ClassNotFoundException:ClassName.class" error, this time we need to check the CLASSPATH environment variable settings is appropriate, Ensure that the JVM is able to find the class package referenced in the Java program.
This example sets the system environment variable:
Set path=%path%; C:\Program Files\java\jdk1.8.0_92\bin;
Set java_home= C:\Program files\java\jdk1.8.0_92
Set classpath=.; %java_home%\lib; %java_home%\lib\tools.jar
where the dot (.) represents the current path.
PS: Both the Java interpreter and other command-line tools know how to find the core class, which is included in the installation. These classes do not have to be included in the Classpath classpath, and the Java interpreter and other tools can find them automatically. The class libraries of most applications take full advantage of the extensibility mechanism, so you need to set the classpath only if you want to load a class library that is not in the current directory or its subcontracting, and is not in the location specified by the extension mechanism.
Essentials for installing JDK and configuring environment variables
The JDK contains the Java program's development environment and also contains the Java program's run-time environment.
When installing the JDK, you can simply choose to use the default option settings provided by the Setup program.
Set environment variables after installing JDK.
After setting the environment variable, it is a good idea to use the SET command in the Command Prompt window to view and confirm that the environment variable is set correctly. If it is not correct, you need to reset the correct environment variables.
You can use search engines on the Internet to find the source of the JDK download, not necessarily to the Java official website to download. If the download source is unofficial, be cautious about verifying that the JDK installation files downloaded are not a security risk.
Download the JDK at the same time download the official "Java SE development Kit 8u91 Demos and Samples", which is a compressed file, when decompressed, you can see that there are many instances of programs and examples of programs, they are good learning materials.
Download, install, and configure the 2.1 JDK