Javaee development tools and environment configuration process, javaee development tool Configuration
I have encountered many problems during the configuration of the javaee development environment. Here, the system will sort out my previous configuration process.
Note: you can read the detailed process of the configuration process from JSP & Servlet learning notes (version 2. All my development tools will be posted at the end of the article
I. Prepare the development environment
1. install Tomcat
Apache Tomcat is used as a Web Container. Download URL:
Http://tomcat.apache.org/download-70.cgi
Note: The Servlet/JSP version used here is Servlet 3.0/JSP 2.2. the Tomcat version that supports this version is Tomcat 7.x or later.
The downloaded Tomcat server comes with a simple HTTP server. Compared with the real HTTP server, the HTTP server function provided by Tomcat is too simple for development purposes only. We do not recommend that you directly launch the service in the future.
2. Install Eclipse
Next, prepare the IDE. Here, use Eclipse (version 3.6 or later is recommended). Download the URL:
Http://www.eclipse.org/downloads/
3. Install JDK
The version used here is Java SE 7. Download URL:
Http://www.oracle.com/technetwork/java/javase/downloads/index.html
4. Configure the Web container as Tomcat in Eclipse
Decompress Eclipse and Tomcat in D: \ workspace.
Perform the following steps:
(1) Run eclipse in the eclipse directory
(2) When the Workspace Launcher dialog box appears, set Workspace: To D: \ workspace and single-host OK.
(3) Select the Window | Preferences command. In the Preferences dialog box, expand the Server node and select the Runtime Environment node.
(4) Add button in Server Runtime Environments on the right of a single machine. In the New Server Runtime Environment dialog box that appears, select Apache Tomcat v7.0 and Next
(5) Click the Browse button next to the single-host Tomcat installation directory, select the Tomcat directory decompressed in D: \ workspace, and click OK on the single-host.
(6) After the standalone is finished, the standalone is OK to complete the configuration.
5. Configure the preset text encoding in the Workspace
UTF-8 is the most widely used Unicode implementation method on the Internet, it is recommended that the relevant encoding is set to UTF-8
(1) Select the Window | Prefences command. In the Preferences dialog box, expand the Workspace node.
(2) select Other in Text file encoding on the right and select UTF-8 from the drop-down list
(3) Expand the Web node on the left, select CSS Files, select UTF-8 In the Encoding on the right
(4) Select HTML Files and select UTF-8 in Encoding on the right
(5) OK in the single-host Preferences dialog box
II. The first Servlet Program
1. IDE uses projects to manage application-related resources
(1) Select File | New | Dynamic Web Project command. In the New Dynamic Web Project dialog box, enter FirstServlet in the Project name text box.
(2) Confirm that the Target runtime is the Apache Tomcat v7.0 just set, and the single machine is finished.
(3) Expand the Java Resources node in the New project, right-click on src, and select New | Servlet command
(4) The Create Servlet dialog box is displayed. Enter com. test in the Java package text box, enter HelloServlet in the Class name text box, and click
(5) Select HelloServlet in URL mappings, click Edit on the right of the single machine, and change Pattern to/hello. view. Then click OK on the single machine.
(6) Finish in the single-host Create Servlet dialog box
Note: After Servlet 3.0, you can use Annotation to notify the container which servlets will provide services and additional information. In previous versions, you must use the web. xml file to define the Servlet.
2. Run Servlet
(1) Right-click HelloServlet. java and select Run As | Run on Server.
(2) In the Run on Server dialog box that appears, confirm that the Server runtime environment is the Apache Tomcat v7.0 that was previously set, and Run
(3) After Tomcat is started, a browser embedded with Eclipse will appear
Note: Servlet API, jsp api related classes are usually encapsulated in Tomcat lib subdirectory servlet-api.jar, jsp-api.jar, follow the previous operation Eclipse will automatically complete the path settings, expand the Libraries/Apache Tomcat v7.0 node in Project Explorer, and you can see the class path settings of the relevant JAR file.
Iii. Import JAR files to Eclipse
1. JSTL download and API file description
Download URL:
Http://www.oracle.com/technetwork/java/index-jsp-135995.html
2. Deployment Assembly settings use JAR files
(1) Right-click the created Project and select Properties. In the displayed Project Properties dialog box, select Deployment Assembly.
(2) Single-host Add button. In the New Assembly ctive ve dialog box, select Archives from File System and then click Next
(3) Click Add on a single machine, select the JAR file source, and click Finish on the single machine.
(4) OK in single-host Web Deployment Assembly
(5) On the Java Resources/Libraries node of the project, you can find that the JAR file has been set under the Web App Libraries.
Note: After the file is successfully deployed, you can find that the JAR file has been set in the/WEB-INF/lib directory under the project Tomcat
Related Development Tools
-JDK7: jdk-7windows-x64_20140115.zip
Https://pan.baidu.com/s/1bo4vHvx
-Eclipse IDE: Eclipseforjavaee64bit.zip
Https://pan.baidu.com/s/1c2kXcn2
-Apache: apache-tomcat-7.0.52-windows-x64.zip
Https://pan.baidu.com/s/1o8HMG2m
-MySQL: mysql-5.1.63-winx64.zip
Https://pan.baidu.com/s/1hsgLidQ
-SQLyog: SQLyog-11.2.5-0.x64.rar
Https://pan.baidu.com/s/1qXN7YFE
-MySQL DRIVER: mysql-connector-java-5.1.16.zip
Https://pan.baidu.com/s/1dFzNywT
-JAVABEANS (tm) activation framework: jaf-1_1_1.zip
Https://pan.baidu.com/s/1dFqZT8P
-Java Mail: javamail4104_4.zip
Https://pan.baidu.com/s/1mic87xA
-JSTL: JSTL 1.1.zip
Https://pan.baidu.com/s/1nu90mDz
-Apache Commons Lang: commons-lang.jar
Https://pan.baidu.com/s/1cxlEs2
JAVA help document Chinese Version
Https://pan.baidu.com/s/1boKAChx