Java programming those things 11--JDK installation, configuration and use of: Chen yuefeng from: http://blog.csdn.net/mailbomb
Chapter 2 establish a development environment"To do well, you must first sharpen your tools ". For program development, first install and develop related software, and be familiar with the basic use of these tools and software. This chapter introduces the use of two types of development tools: L basic development tools are the basis for program design, including some basic functions required in development, such as compilation and running, is the basis of other development tools. The basic Java development tool is a free JDK provided by Sun. In actual development, basic development tools are generally not directly used for convenience and program development efficiency. Therefore, you only need to master the basic usage of many basic development tools. L integrated development environment (IDE) integrated development environment refers to integrating a series of functions required by programming, such as code editing, code debugging, program deployment, and so on, into a program, it facilitates program development and increases the actual development efficiency, simplifying many operations in program design. There are many integrated development environments in Java, including eclipse, JBuilder, and netbeans. In actual development, the integrated development environment is basically used for development, so you must be familiar with the use of this type of tool in learning. Generally, the use of integrated development environments is very similar. If you are familiar with one of them during learning, other tools are easy to learn. This article takes eclipse as an example to introduce the basic use of the integrated development environment.
2.1 JDK Development EnvironmentJDK (Java developer's kit), Java developer kit, also known as j2sdk (Java 2 software development kit), is a basic Java language development tool provided by Sun, the tool software includes Java compilation tools, running tools, and execution program Environment (JRE ). JDK is now an open-source and free tool. JDK is the basis of other Java development tools. That is to say, JDK must be installed before other development tools are installed. For beginners, if you use this development tool for learning, you can focus on learning the Java language syntax at the beginning of the learning, and learn more about the underlying knowledge, it is helpful for future program development. However, JDK does not provide a JAVA Source Code compiling environment, which is a common problem of many basic development tools provided by Sun. Therefore, the actual code compilation needs to be performed in other text editors. In fact, the source code of most programming languages is a text file, but it is stored as a different suffix. There are many common text editors suitable for Java, such as jcreator, editplus, and ultraedit. The following describes how to download, install, configure, and use JDK.
2.1.1 JDK acquisitionIf you need to get the latest JDK, you can go to the official website of sun to download, for: http://java.sun.com/javase/downloads/index.jsp to download the latest version of JDK 6 Update 6, select the corresponding operating system, and the language used. When downloading the Windows version, there are two versions available for download: l Windows Online installation online installation version. Each installation will download the installation program from the network. After the download is complete, for installation. L offline installation version of Windows offline installation, which is directly installed locally at each installation. Generally, the offline installation version is downloaded. In fact, if you do not need to install the latest version, you can also download the JDK installation program from mainstream download sites in China, but the version of these programs may be slightly older, these are not very problematic for beginners.
2.1.2 JDK InstallationJDK installer on Windows operating system is an EXE executable program. You can directly install it. During the installation process, you can select the installation path and installed components. If there are no special requirements, select the default settings. The default installation path of the program is in the C:/program files/Java directory.
2.1.3 JDK ConfigurationAfter JDK is installed, you can use it without setting it. However, for ease of use, simple configuration is generally required. Because the compilation and running tools provided by JDK are based on command line, you need to set the following DOs, add the executable files in the bin directory under the JDK installation directory to the DOS External commands, so that you can directly use the EXE program under the bin directory in any path. The configured parameter is the path environment variable in the operating system. This variable is used by the system to find the path of the executable program. Configuration steps: 1. "Start"> "Settings"> "Control Panel"> "system". If the control panel is not set in the Classic mode, you can find "system" in "performance and maintenance" of the control panel ". Of course, you can also select "my computer" on the desktop, right-click and select "properties" to open it. 2. In the "System Properties" window, select the "environment variables" button on the "advanced" property page. 3. In the "environment variables" window, select the environment variable named "path" in "system variables" and double-click the variable. 4. Add the absolute path of the bin directory in the JDK installation path to the value of the PATH variable and separate it with an existing path using a half-width semicolon. For example, if the bin path in the JDK installation path is C:/program files/Java/jdk1.6.0 _ 04/bin, add the path to the starting position of the path value, and the value is: c:/program files/Java/jdk1.6.0 _ 04/bin; C:/program files/PC Connectivity Solution/; C:/program files/Java/jdk1.6.0 _ 04/bin; c:/j2sdk1.4.2 _ 11/bin; % SystemRoot %/system32; % SystemRoot %/system32/WBEM paths may be different on different computers. After the configuration is complete, you can use the following format to test whether the configuration is successful: 1. Open "start"> "program"> "attachment"> "command prompt" 2. In the "command prompt" window, enter javac, press enter to run the command. If the output content is instructions, the configuration is successful. If the output content is "'javac', it is neither an internal or external command, nor an executable program or a batch processing file .", The configuration is incorrect. You need to reconfigure it. The common configuration error is: 1) path error. The path should be similar to C:/program files/Java/jdk1.6.0 _ 04/bin. 2) an error occurs when you separate semicolons (;). For example, enter a colon in the incorrect format or use a full-width semicolon.