If you want to write a program in the Java language, you have to build a Java development environment, install the JDK, and then configure the environment variables.
One: Download jdk
Today's JDK is the main mainstream of the Sun's JDK, of course, IBM and some other commercial companies have developed their own JDK, improve the efficiency of programming, here we take the Sun company JDK as an example.
jdk:https://www.oracle.com/downloads/index.html, enter the URL address, the page jumps to the following page, then we select Java SE:
Jump to the following page, then we select the caption shown in the red box:
Next jump to:
There are various versions of the JDK, now the current page is the latest jdk8u66, is the JDK8 upgrade version 66, the latest is not recommended for everyone to use:
1: Bad compatibility with operating system (WINDOWS8,WINDOWS10) or IDE
2: Instability, especially when co-development, low-version development of the program to the new version will be error, it is not recommended.
It is recommended to use the JDK6 version (development), of course, if you can learn to choose freely, so you can continue to choose other versions of the JDK, as follows:
This is the previous version and can be selected by the learner:
The JDK downloads say so much.
II: Install JDK
Once the JDK is downloaded, it will be installed.
1: Double-click the application to start the installation:
As the installation is directed,
You can change the installation directory here, which is no longer installed because the JDK was previously installed on this computer. After you install the JDK, you are prompted to install the JRE application because
The JDK program includes the JRE, so the next application does not need to be installed again.
Three: Configure environment variables
After installing the JDK, configure the environment variables:
1: "Computer" right--property, go to the following page:
2: Click on "Advanced system Settings" to enter the following page:
3: Click on "Environment variables", you can configure Javahome, path, classpath:
4: Meaning of the various variables configured
Java_home: Is the JDK installation path, my installation directory is: F:\Program files\jdk1.6, so even if you need to change the JDK path later, modify Java_home directly, do not have to modify
Path and Classpath.
Path:%java_home%\bin;%java_home%\jre\bin; point to the bin directory, so call Javac compile the source file, or call the JAVA command to run the bytecode file, first in the current directory to find,
If it is not found, it will look in the path.
Classpath:.; %java_home%\lib;%java_home%\lib\tools.jar, pointing to the file path that needs to be run, in fact this classpath can not be configured, in future development will not affect.
Download and install the JDK, and configure the Java environment variables