Javaweb Learning (3.5)---Eclipse and tomcat

Source: Internet
Author: User

I. Configuring Tomcat in Eclipse

  Preparation tools:

  Eclipse Java EE version (see,, Standard version has to be another plug-in, the cup I spent a day not to install, and finally re-downloaded the Java version,, Qaq)

Apache-tomcat ( This version is not much required, remember the version number to facilitate the next configuration can be )

A bunch of online tutorials like JDK installation configuration, not here, just say the steps to configure Tomcat in Eclipse.

1. Turn on eclipse, as shown in the figure, File–new–other

2. Enter the server in the pop-up interface, as shown in the image, OK, select this server here, then click Next

3. Select the Tomcat server under Apache as shown in the image below, then click on the section in the circle in the diagram, which is the add, here to configure the Tomcat path

4. you can see the interface as shown in the image, name refers to the server name you want to set, you can default, you can also write your favorite name

The path in the first lap represents the path of Tomcat, click Browse in the back, select the Tomcat path you use on your computer.

The following JRE, you can choose the first default eclipse of the JDK, you can also choose your own installed JDK, finished click Finish

  

5. Now that Tomcat is configured, start Tomcat and you'll see some information about the console output.

This is a successful tomcat configuration. Also, when you create a new Web project, you can also configure Tomcat, which is similar to the above, and you will not repeat ~~~~~~~

Second, the Web project in Eclipse is automatically deployed to Tomcat (new eclipse applies)

  

In the new version of Eclipse, the project was configured, and after it was released, it was found that the project could not be found under Tomcat's WebApps, there was a project in the Eclipse workspace, but the actual release was actually \.metadata\ in the workspace directory. under the Plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps. This means that you are trying to read extra files from the project directory under the workspace directory, such as documents, pictures, etc. completely impossible!!! (Don't ask me how I know ~~~~~~~~5555555555) the solution is to reconfigure the release path of Eclipse under Tomcat for the project.

If you do not abandon the above path is very deep, the next content will not see,,,

Ways to change the publishing path:

1. In the bottom servers view of Eclipse, remove all deployed projects and right-click ' Clean ', otherwise the server location of the steps below will be gray and immutable. . : (Note that the servers is below the middle of the interface )

2. On the server, right-click to select "Open", or press F3 shortcut in the blank, or double-click to open the following page:

3. At "Server Locations", select "Use Tomcat Installation", you can see clearly that the default is "used Workspace metadata", that is, the above-mentioned directory. Then write the WebApps on the path of the deploy, as shown in:

After the modification is complete, save it. Later projects will be published under Tomcat under the WebApps.

Note: 1. In Eclipse, publishing a Web project in this way will divide the Conf folder of the original server into a backup folder and create a new folder of its own to serve as a Web project for configuring Eclipse Publishing.

2. Sometimes, under the server locations project, nothing is optional, you can delete the server, re-add the Tomcat server, then right-click Open, Modify.

--------------------------------------------------------------------------------------------------------------- -----

In fact, the simplest way is to modify the-dwtp.deploy property of the VM arguments. The property location is: VM Arguments, Arguments, run configurations, Eclipse menu bar run.

Hee Hee

Javaweb Learning (3.5)---Eclipse and tomcat

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.