For Java development, you first install the JDK (Java Development Kit,java Development Toolbox).
The JDK is a collection of tools that are necessary to compile Java source code, run Java programs, such as JVMS, base class libraries, compilers, packaging tools, and so on. No matter what kind of Java application Server is built in a version of the JDK, so mastering the JDK is the first step to learn Java.
Some of the tools provided by the JDK:
- java compiler: Javac.exe
- Java Interpreter: Java.exe
- Java Document generator: Javadoc.exe
- Java Debugger: Jdb.exe
The Java version mentioned above actually refers to the version of the JDK.
The most mainstream JDK is the JDK released by Sun, and in addition to sun, many companies and organizations have developed their own JDK, such as the JDK developed by IBM, the jrocket of BEA, and the JDK developed by the GNU organization, among others. IBM's JDK contains a JVM (Java Virtual machine) that runs much more efficiently than the JVM contained in the Sun JDK, and is designed to run Jrocket on the x86 platform and is much more efficient on the server than the Sun jdk, but anyway. The Sun JDK needs to be mastered first.
Download of JDK
There are different versions of JDK (J2SE, Java EE, J2ME), and beginners are generally choosing J2SE. The J2SE is: http://www.oracle.com/technetwork/java/javase/downloads/index.html
Open the URL and you'll see a page like this:
Figure 1 J2se (Java SE) download page
Download the JDK to accept the corresponding terms, default is not downloadable.
Select the appropriate operating system, click the download link to download.
Installation of the JDK
Double-click on the downloaded installation package to install, click "Next", appear as shown in the interface:
Figure 2 Changing the installation directory
You can change the JDK's installation directory according to your habits, but keep in mind that the installation directory will be used later.
As you can see, the JDK contains Java development tools (compilers, packaging tools, etc.), source code (base Class library), and public JRE, all of which are installed by default and are necessary for Java development. Three
Click "Next" to wait for the installation.
Figure 3 Installing
After the JDK installation is complete, you will be prompted to install the JRE as shown in:
Figure 4 whether to install the JRE
The JDK already contains the JRE, no need to install again, click "Cancel".
Figure 5 Confirm cancellation
Figure 6 Completing the installation
Click "Close" to complete the installation.
Settings for Environment variables
Enter the environment Variable configuration window, in "User variables", set 3 properties, Java_home, PATH, CLASSPATH (case does not matter), if already exist then click "Edit", not exist then click "New":
- Java_home: Set the installation path for the JDK (such as D:\Program files\jdk1.7.0_71), this path includes folders such as LIB,BIN,JRE (this variable is best set because Tomcat is run later, Eclipse and so on need to rely on this variable).
- Path: Allows the system to identify JAVA commands under any path, set to:%java_home%\bin. %java_home% is a reference to the Java_home variable specified earlier.
- Classpath:java Run Environment Load class path, only class in CLASSPATH, can be recognized and loaded, set to.; %java_home%\lib (Note the preceding dot (.), the dot indicates the current path).
Open a CMD window, enter the "java-version" command, and see this information to prove that the installation and configuration were successful.
Construction of 5.Java development environment