• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Trying to run my first servlet through Eclipse + XAMPP

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic