File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Error regarding Import servlet package Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Error regarding Import servlet package" Watch "Error regarding Import servlet package" New topic

Error regarding Import servlet package

chintan ramavat
Ranch Hand

Joined: Sep 15, 2006
Posts: 134
Hello friends,

i am trying to run one Servlet using JDK1.5 , actually not trying run exactly but trying to have .class file once I have .java compiled. but it giving me errors while i attempt to compile using following statements.

import javax.servlet.*;
import javax.servlet.http.*;

it would be really great if somebody can give any suggestion either on JDK version problem or anything else..

- Thank you
- CHI :roll:
Jaikiran Pai

Joined: Jul 20, 2005
Posts: 10441

Does this help?

[My Blog] [JavaRanch Journal]
Herman Schelti
Ranch Hand

Joined: Jul 17, 2006
Posts: 387

To compile a servlet you need Java's Enterprise Edition (J2EE 1.4 or JEE5) as well.
Which IDE or webserver do you use?
(they usually already have what you need).

chintan ramavat
Ranch Hand

Joined: Sep 15, 2006
Posts: 134
Thank you Jaikiran and Herman for an instant reply, I really appreciate.
In fact I had a problem with setting up CLASSPATH and finding packages around.
I got the code working now.

It was bit easy using Sun App but I am using TOMCAT5.5 so had to locate different packages. anyway again thank you very much for a quick reply. just minutes before i got it working so now.

- regards,
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Moving to Java In General (Beginner) where all javac and classpath discussions are held.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: Error regarding Import servlet package
It's not a secret anymore!