File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes IDEs, Version Control and other tools and the fly likes Servlet + Eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Servlet + Eclipse" Watch "Servlet + Eclipse" New topic

Servlet + Eclipse

Allen Bandela
Ranch Hand

Joined: Feb 16, 2006
Posts: 128

Hi all,
I am not sure if I should post this question , but I'm sure many people would have used Eclipse. How am I supposed to configure Eclipse to compile servlets. I tried to set the classpath environment variable to servlet.jar, but it does'nt work. I've been using Eclipse for core java programs so far. Please help. Thank you.
M Anderson

Joined: Mar 17, 2006
Posts: 25
Be sure to start a 'web' project. If you do, Eclispe will bring all the needed jars into your project and should have no problem compiling. You may need to download the Web Tools Project (WTP) first, if Eclipse isn't offering a 'web' project to you now.

Of course, you could just add the needed jars to the project's properties (Java Build Path). But the WTP is pretty cool in that it sets up your project folders for you like a J2EE Web App, and creates a web.xml for you, etc.

Hope this helps!

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63866

Moved to the IDEs forum.

[Asking smart questions] [About Bear] [Books by Bear]
Frank Carver

Joined: Jan 07, 1999
Posts: 6920
I compile servlets and web stuff all the time and I've never needed to create a "web" project or download any Eclipse extensions. What I have done, though, is to add the servlet.jar to the project classpath settings:

project / properties / java build path / libraries / add external JARs

Remember that Eclipse (like lots of other software these days) ignores the external classpath variable, and manages its own classpath sesttings for each project.

Read about me at ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
I agree. Here's the link:
subject: Servlet + Eclipse
It's not a secret anymore!