Environment:Win 7 + JDK 1.7 + Eclipse IDE for Java EE developers 3.7 +tomcat 6.0
First, prepare the software:
Jdk:
Ide:
Server:
(i) Installing and configuring the JDK
The JDK comes with a JRE and does not need to be downloaded separately.
Open the JDK installation,
Select the installation directory, next, install the JDK, ask whether to install the JRE, choose Next,
Finally ask if you want to install Java FX,
After loading, the JDK is fully installed, the JDK is configured below,
Open, computers, properties, advanced system settings, environment variables
1. New system variable java_home (JDK installation path)
C:\Program files\java\jdk1.7.0_03
2. Edit Path
Added in front:%java_home%\bin;
3. New system Variable Classpath
.; %java_home%\lib;%java_home%\lib\dt.jar;%java_home%\lib\tools.jar
Notice the third sentence, the front point,
After configuration, open cmd, enter: java-version
The following information will appear:
Java Version "1.7.0_03"
Java (TM) SE Runtime Environment (build 1.7.0_03-b05)
Java HotSpot (TM) Client VMs (build 22.1-b02, mixed mode, sharing)
,,,
Indicates that the JDK configuration was successful,
(ii) installation of Tomcat
When I do it myself, I just unzip it and add Tomcat from Eclipse.
Proceed to the next step and then let you specify the JDK installation directory, if the default is incorrect, modify it,
Complete the installation,
In the browser, type: http://loaclhost:8080
Appear as:
(iii) Configuring Web Sever
Eclipse does not need to be installed, the decompression can be used,
Open Eclipse, create a new dynamic Web project,
Now configure Tomcat, point new Runtime,
Choose Tomcat 6.0
Next, then click Browse, select the Tomcat installation directory, other default,
And then point to finish,
Create Project completion,
Create a new JSP file in the project, by default in the WebContent folder,
Add Hello to <body></body> Java ee
Then right-click in the Server window and create a new server
Add the project to the next step, then select version Tomcat 6.0, complete,
In the server window, right-click on the Tomcat server and start the service to see the Open JSP Web page.
If the following error occurs:
The reason is that port 8080 is occupied, look at the network port,
Sure enough, 8080 ports are occupied, a tomcat has been started, the process is killed,
Restart server, Normal,
So far, the development environment has been built.
To import a project:
File-import
Select the location where you want to import the files and import them
If you encounter an error after importing a file:
See what the error is:
The servlet was not added correctly: Right-click on Project-Properties-java build path-libraries-addjars-to find the package in the Tomcat directory under bin
@page Fork in front: Properties->java Build path->libraries->add libraries->server Runtime, select Tomcat Server
How to configure the Java EE ECLIPSE+TOMCAT development environment and import projects