Home CV Contact Art Music Apps Misc Search
Developing Servlets with Eclipse
Developing Servlets with Eclipse

This is more of a note to myself then a guide.


  • Download and install the latest Jave Development Kit (JDK).
    (http://java.sun.com/javase/downloads/index.jsp )

  • Download and install Eclipse Classic SDK (or your preferred version)
    (http://www.eclipse.org )

  • Download and install the latest Apache Tomcat. Do not bother with installer versions, just unpack the binaries to your preferred folder.
    (http://tomcat.apache.org )

  • Download Sysdeo Eclipse Tomcat Launcher Plugin for Eclipse. Install by moving the folder to ECLIPSE_HOME/plugin. Run eclipse with -clean flag. Config plugin by Eclipse -> Window -> Preferences -> Tomcat -> Tomcast Home -> Enter TOMCAT_HOME .
    (http://www.eclipsetotale.com/tomcatPlugin.html )

  • To create servlet, first Eclipse -> File -> New -> Other -> Java -> Tomcat Project to create a context, then create java package in WEB-INF/src and a class that extends HttpServlet. Make sure the WEB-INF/web.xml exists.

  • External JAR(s) goes into the PROJECT_HOME/web/WEB-INF/yourlibfolder and after adding these to eclipse projcet buildpath as usual do Eclipse -> Navigator -> Right-click on your tomcast project -> Properties -> Tomcat -> DevLoader Classpath -> Check Activate DevLoader and check "your external JAR(s)". If you get class not found exception for DevLoader, you must provide the dev loader manually. Search your Sysdeo Eclipse Tomcat Launcher Plugin folder for DevFolder.zip and unpack to TOMCAT_HOME/lib or TOMCAT_HOME/server/classes/

  • Look for little tomcat icons in Eclipse for starting the tomcat server. Visit http://localhost:8080/manager/html for deploying your WAR file. Or preferably you use Sysdeo Eclipse Tomcat Launcher Plugin and Right-click Project -> Tomcat Project -> Update context definition to register your context in tomcat.

  • If you develop without any framework and delete projects and stuff, you will most likely be cleaning up yourself. Look for a folder something like TOMCAT_HOME\conf\Catalina\localhost or similar and delete context def files.



This document was created 080223 and updated 090808.
If you enjoyed this page you might want to have a look at this:
Programming, Developing J2ME on Mac OS X, Applications, Some Sort of Curriculum Vitae.