How can I add my application to Tomcat in Eclipse?

前端 未结 11 1500
迷失自我
迷失自我 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: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.

提交回复
热议问题