Translate

Monday 8 April 2013

HOW TO: Set Tomcat 7 runtime in Eclipse

It is pretty handy to manage your run time server from within IDE, so you can handle development easily and focus on it. Here I show you how to set it on Eclipse.


  1. Go to Server tab at the bottom of your eclipse, or you can open it by opening Window > Show View > Others then search for servers. yes click that, and click new server wizard.

  2. On the next window, you select the target runtime for tomcat 7, and click next. 
  3. on the next page, you browse for the installation folder of your Tomcat and select the JRE, to set up custom JRE go to step 4 by clicking the installed JRE, otherwise just select workbench default jre just skip to step 5.
  4. To add new JRE, click add button. and then select the Standard VM, then find for the directory where you put your preferred JDK, and click finish.
    after you click finish here, then you click Next then Finish at the window shown in point 3, or just click Finish there.
  5. There is your server already set up.
    Tadaaaaa... congratulation. It is done.

    But Wait, It does not work fine... Trust me
    Eclipse will copy the configuration file of tomcat server into your workspace and then whenever you start the server, it will show server started, but when you hit http://localhost:8080 it will show 404 page not found. so Whats wrong? actually we should tell eclipse to use the existing server configuration as in your existing server installation. 

    Double click the server there, and in the server overview, look at the server location, then select the second option to use the tomcat installation. 
    That is it, now start your server and check it on the browser.

    Note: I use eclipse Indigo, but this how-to should apply to any version of eclipse. should you have any question, just post on the comment.


No comments:

Post a Comment