Create a Java Web project with eclipse

Source: Internet
Author: User

1. Create a Web project, created here with eclipse (if you are familiar with creating a Web project, you can do it without looking at it, the purpose of this article is to make a record)

1) Open the New Project dialog box, select Dynamic Web project and click Next,

2) In the Project Setup window that appears, set the name of the project and the Dynamic Web module version (the corresponding servlet version, the different Dynamic Web module version corresponds to the generated Project Web. xml). The Web Component version is not compatible. Tomcat6 generally corresponds to 2.4 or 2.5,TOMCAT7 corresponds to 3)

3) Click Next to specify the compilation path of the Java file (I am generally set to webroot\web-inf\classes),

4) Click Next, you can set the Web project root directory (that is, the subordinate path, generally I set to Webroot),

5) If you need to change some settings at the time of project creation, you can right click on the project directory, in the popup menu, select the Properties option, in the Popup Settings dialog box, you can set the Web project root directory (that is, the subordinate path, generally I set to Webroot), and the dynamic Settings for Web module version:

6) Right-click the project directory and select Build Path->configure build Path ... Options

7) In the popup dialog box, delete all the class libraries,

8) Add the deployment environment, this article is Tomcat, as follows:

1> Open service View, step

The following dialog box appears:

Click OK and the following view appears:

Next, the following dialog box appears, selecting the appropriate catalina_home:

Then you can complete the deployment of the Tomcat server for the Web project, such as, right-click the Tomcat server and start Tomcat to run the project.

2>tomcat the boot parameter needs to be set, double-click the Tomcat icon in the server view and the Settings page appears as follows:

9) According to the steps, set Jre,server Runtime (to set up in the subordinate, that is, the server such as the Tomcat environment jar package, such as Servlet.jar, etc.), the Web App Libraries class library (used in the project under the Lib directory of the Jar package, set up this, you can dynamically add to the project Webroot/web-inf/lib in the dynamic Jar package), the setup process is as follows:

1> Click Add Liberary ... button, select the JRE System Library in the popup dialog box, click Next,

2> in the popup dialog box, select Alternate JRE, click the intalled jres button, set the JDK for the project to run,

3> in the popup dialog box, select Add ... Button

4> Click Next, in the Pop-up dialog box, click Directory ... , select the locally installed JDK directory (i.e., java_home),

5> Click OK, the following dialog box appears, indicating that the JDK was set up successfully,

Click Finish, and then select the JDK you just added:

6> Click OK, set the JRE to succeed, and then go back to the Add Class Library page to add the Web App Libraries,

Click Next:

7> then goes back to the Add Class Library page, adding server Runtime,

Create a Java Web project with Eclipse

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.