tags:

views:

287

answers:

4

I haven't been using Java extensively hence forget a lot fundamental things. Basically, I am working with a web-dynamic project (using Eclipse IDE with jdk 1.6), and during the build, I get errors that Cookie class and other web related classes cannot be found. What am I missing?

What Jars files do I need to add (and how)?

thanks

A: 

Servlets are only part of the Enterprise Edition, not of the Standard Edition of Java. So you need the Java Enterprise Edition, AKA Java EE.

http://java.sun.com/javaee/

sleske
A: 

Sounds like you are missing servlet-api.jar

You can download it from the Maven repository.

Phill Sacre
+1  A: 

Think you need servlet-api.jar

Try here for any jar files you need http://www.java2s.com/Code/Jar/CatalogJar.htm

Sandeep Rajeev
A: 

As others have said, you're missing the server api jar.

Having said that, downloading just the servlet api jar and not the server that goes with it means that you can't actually test your code.

In Eclipse, once you're installed a servlet container, such as Sun's Glassfish, Apache Tomcat, or Jetty, you can create a server instance of it so that Eclipse will compile against your server's servlet implementation. Creating a server instance also means that Eclipse's Run on Server command works.

IBM has a slightly outdated guide on Developing Web applications with Tomcat and Eclipse. The entire "Install the Web tools" section can be skipped if you have the Eclipse EE version, as Web Tools are already installed.

R. Bemrose