Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet + Eclipse

 
Allen Bandela
Ranch Hand
Posts: 128
Eclipse IDE MS IE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Allen
 
M Anderson
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 64683
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to the IDEs forum.
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic