As a Java programmer, configuring a Java development environment is a necessary skill. Today I will give you a lesson to the majority of novices. The configuration of the environment is roughly divided into three 1, JDK 2, Tomcat (or others) 3, eclipse (or myeclipse). Let's configure it one by one.
Configure JDK
Writing Java programs requires establishing a Java development environment, among which Sun's Java SDK is essential. You can download it on Sun's official website, and I won't go into details here. After installing the SDK, you need to simply configure the environment variables:
1. Right-click on my computer and select Properties (or press "Win+Pause Break")
2. Choose Advanced
3. Select environment variables (system variables)
If the following variable names are not available, click Create New, and click Edit (separated by English semicolons between the two paths). The variable value is the content in quotes:
4. New variable name: JAVA_HOME Variable value: "C:/Program Files/Java/jdk1.7.0" (that is the installation path of JDK, which can be customized)
5. New variable name: PATH variable value: "C:/Program Files/Java/jdk1.7.0/bin;%JAVA_HOME%/bin"
6. New variable name: CLASSPATH Variable value: ".;%JAVA_HOME%/lib;%JAVA_HOME%/lib/tools.jar"
After configuration, you need to test whether it is successful
1. The WIN+R key combination pops up the command run window (or "Start->Run")
2. Enter the command CMD Enter
3. Enter in the pop-up DOS window: java -version will appear version information. Enter: javac usage information (there are many usages). If the following figure shows, the configuration will be successful, otherwise the configuration will fail.
Configure Tomcat
Download Tomcat and decompress it directly, and then configure its environment variables:
New variable name: TOMCAT_HOME Variable value: "D:/Tomcat 7.0" (This is the directory you decompressed, anywhere is OK, but it is best to be in English path)
The following is the test. Enter: http://localhost:8080/ in the browser: If the following screen appears, it means that it is successful, otherwise it will not be matched.
Configure eclipse
We download the Eclipse IDE for Java EE Developers version, and eclipse can also be used by decompression. Let's mainly talk about its integration with JDK.
When you open eclipse, it will let you choose the storage location of the project, that is, [workspace], which you can choose according to your needs.
After opening eclipse, select [window]―>[preferences] in eclipse, select [java]―>[Installed JRES] on the left side of the window and click the [Add] button to appear the following picture:
Click [Directory] to select the installation directory of JDK and introduce JDK. Finally click [Finish] and the task is done.
So far, our java development environment has been configured and we can start writing code happily together. I hope everyone can experience happiness in programming! Come on, everyone!
The above is all the content of this article. I hope it will be helpful to everyone's learning and I hope everyone will support Wulin.com more.