How can I add my application to Tomcat in Eclipse?

前端 未结 11 1447
迷失自我
迷失自我 2020-12-24 00:32

I have a web app built with Maven. Most of the time, I built the application using Intellij IDEA, but now I want to import the application in Eclipse to see something in th

相关标签:
11条回答
  • 2020-12-24 01:34

    This step worked for me:

    Right-Click on the Project Name, then Maven-->Update Project.. Click OK

    After doing this I was able to see my project in Add/Remove Programs.

    As mentioned somewhere else adding Eclipse WTP didn't do any good, however I performed the above step after I had already added Eclipse WTP, so I am guessing that may not be needed. This was done for Eclipse Juno.

    Hope this helps someone.

    Edited: You can follow this link as above mentioned I think might have needed WTP and that add a lot of other things into the workspace.

    http://blog.teamextension.com/maven-as-eclipse-dynamic-web-module-556

    0 讨论(0)
  • 2020-12-24 01:34
    1. Check whether Maven Integration for Eclipse WTP is installed. If not, install it from Eclipse Marketplace
    2. After installation restart Eclipse
    3. Right click your project and Maven--> update project configuration
    4. Delete tomcat and re create tomcat (clean tomcat,add your project,publish and enjoy)
    0 讨论(0)
  • 2020-12-24 01:36

    Maybe you don't need add your application to the server's configuration. I think that you must use m2e eclipse plugin in order to launch the app.

    For example, in your eclipse you will see a contextual menu called "Run as" if you right-click on your pom file. You can clicking on "Maven build" and Maven will download all the information needed to start tomcat.

    I hope this helps you.

    0 讨论(0)
  • 2020-12-24 01:37

    Well, with a Spring and maven project, i got it that way:

    • Eclipse Version: 2019-06 (4.12.0)
    • Java 1.8
    • Tomcat 7

    Yes, go to Project Properties >> Facets >> select Dynamic Web Module but dont apply yet!!!

    Right under, it should appear a link Further Configuration Available. Click on it, otherwise one will have to edit .settings/org.eclipse.wst.common.component manually. Update source directory to src/main/java. (source)

    Then in Facets window check Java - mine was pointing to 11 even though i don't have Java 11 installed or configured like a JRE runtime. I could only add/remove when changed to 1.8. (source). Note: That was really the problem, why don't Eclipse get this configuration automatically from the project?

    Finally Eclipse creates some directories like WEB-INF and META-INF, just delete them.

    0 讨论(0)
  • 2020-12-24 01:38

    I've got Tomcat 6, Java 1.6, and was trying to get it to work in Eclipse Juno Service Release 1's "internal server" (whatever that's called.) Here's what I did that worked for me:

    (Found these instructions at http://www.mkyong.com/eclipse/eclipse-ide-tomcat-version-6-0-only-supports-j2ee-1-2-1-3-1-4-and-java-ee-5-web-modules/)

    1. I should point out that I followed ClutchDude's instructions to make my project a Dynamic Web Module facet. It didn't work on its own for me, but maybe it was part of making it work in the end.

    2. Using Eclipse (or other text editor), open the file

      .settings/org.eclipse.wst.common.project.facet.core.xml

    3. Find the line that reads

      <installed facet="jst.web" version="3.0"/>

    4. 3.0 is for Tomcat 7.x (so says mkyong.) Change it to 2.5 (or 2.4).

    I restarted Eclipse and it worked for my project.

    0 讨论(0)
提交回复
热议问题