Importing Dynamic Web Project into Eclipse

前端 未结 5 761
独厮守ぢ
独厮守ぢ 2021-02-06 19:03

I\'ve been working on a dynamic web project in Eclipse. I have recently reInstalled my OS and I use a clean eclipse. I can import my web project, but when I try to lunch (run on

相关标签:
5条回答
  • 2021-02-06 19:29

    On the dialog before you get the "The selection cannot be run on any server" alert, in the upper right side it tells you why you can't add it to the selected server. For me, it was because my Tomcat 8.0 server couldn't run JRE 1.8 projects.

    I solved it by creating a new Tomcat 8.0 server, changing the runtime environment from Tomcat 8.0 to my 1.8 jre. Then I could run my project on the new server.

    0 讨论(0)
  • 2021-02-06 19:37

    I know this is too late but it will help a googler who accidentally stumbled here while chasing the rabbit hole. Make sure java version stated in the project facet is compatible with your tomcat. Project facet->java (you can right click and change the version)

    0 讨论(0)
  • 2021-02-06 19:39

    OK. My experience is not exactly the same as the poster, but rather than ask a similar question and answer it myself, I'll add my two pennyworth here.

    When I have tried to import a dynamic web project from work onto my home machine — both Eclipse projects — using

    Import -> Existing Projects into Workspace

    I have always ended up with a red exclamation mark against my imported project. Googling indicates that this means the project contains build path errors. Following the advice in the ticked answer above I

    "Right click the project -> Build path -> Configure build path".

    There I find that the JRE System Library has a red cross against it. What to do? This worked:

    1. Delete the JRE System library entry using the Remove button.

    2. Click the Add Library button and select JRE System library. I accepted the default Workspace default JRE.

    So I don't have the reconstruction fag any more. (I assume there must be differences between the installations on the two machines, although both are running the same version of Mac OS.)

    0 讨论(0)
  • 2021-02-06 19:45

    If you import an exported dynamic web project, eclipse will import it as a java project. You have to change the project type manually. For example like this: convert java project to dynamic web project

    0 讨论(0)
  • 2021-02-06 19:46

    If I understand you correctly you have imported a previously working web project into a clean install of Eclipse (and OS) and you are tying to run the project on Tomcat. There could be a number of reasons why it isn't working, here are some things to consider in troubleshooting:

    1. First thing to validate is whether or not Tomcat has been installed correctly and is running without errors. You say you installed a Tomcat plugin for Eclipse. I didn't know there was one. I usually install Tomcat separately and then configure Tomcat settings in Eclipse. Or did you install Tomcat via the Servers view? Windows -> View -> Other -> Server -> Servers, right click in Server view and go New -> Server. Select Apache and then Tomcat?
    2. Can you start and stop Tomcat within Eclipse? If so can you open a browser and navigate to http://localhost:8080 - a Tomcat console should display. Check the logs there shouldn't be any errors.
    3. You should be able to right click on your web project and say run on server and select Tomcat. Alternatively in the Server view right click on the Tomcat server and select Add and Remove.
    4. If the 3rd step didn't work it is possible that the imported project has errors. Could be referencing Libraries that don't exist or paths that are invalid. Open the problems view and see if there are any compile errors. Open the errors view and see if there are any eclipse errors. Right click the project -> Build path -> Configure build path. Examine the reference libraries and see if there are any errors or warnings.
    5. If you the above all works and you have still not made any progress try creating a simple dynamic web application from scratch and run that on the server.
    0 讨论(0)
提交回复
热议问题