Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Trying to run my first servlet through Eclipse + XAMPP

 
Hall Nation
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to run my first servlet through eclipse, I'm using XAMPP + Tomcat add-on as my webserver. How do I even try and compile my servlet ? I've added the external jar Servlet-api.jar to my project as stated in here, http://www.theserverside.com/discussions/thread.tss?thread_id=37924
But eclipse wouldn't compile it, because there just isn't a main() in my servlet program..

Do I need to install the WPT plugin for eclipse? I'm guessing I'm not setting my CLASSPATH correctly - Do I need to set it up manually?
 
Peter Johnson
author
Bartender
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you downloaded Eclipse, did you choose the "Eclipse for Java EE Developer's" package? If not, go back and do that - that package contains WPT and various other packages helpful for building and running servlets.
 
Hall Nation
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well Peter,

Nevermind, there were lots of Issues going the XAMPP way, so I just installed Tomcat separately and all is fine now.

I used instructions from http://www.scribd.com/doc/495993/Installing-Apache-Tomcat-6-and-Using-It-With-Eclipse and it was just a walk-in-the-park..

EDIT :

I have one small quirk though..
Let's just say I'm trying a basic 'Dynamic Web Application' in Eclipse (I have the Java EE Developers' package installed), with a basic helloworld servlet like this : http://codepad.org/KzSB4m6z. Everytime, I need to put in the .CLASS that gets generated in the 'eclipse_workspace> proj_name > build > classes ' into 'eclipse_workspace> proj_name > WebContent' manually. Is there an automatic setting that does this ? I find that only by manually copying the .CLASS file to the location I mentioned does it work, otherwise it refuses to.
I'm using the local instance of Apache Tomcat from within Eclipse.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic