1

Possible Duplicate:
How do I import the javax.servlet API in my Eclipse project?

When I try to use javax.servlet.http.*; an error package does not exist is thrown. Should I want to reinstall java or it occurs due to some other problem. I'm using j2sdk 1.4.0 & Tomcat 6.0.

Community
  • 1
  • 1
user67722
  • 3,217
  • 5
  • 24
  • 20

1 Answers1

1

Guess servlet.jar is not on the classpath. Assuming you are on Windows, right click on My Computer -> Properties -> Advanced -> Environment Variables, and check your CLASSPATH entry.

Shivasubramanian A
  • 4,346
  • 6
  • 29
  • 26
  • This is a bad advice. This needs to be solved by associating the project with a specific target runtime. See also the "possible duplicate" link on the question. – BalusC Jan 09 '13 at 12:36
  • Why is this bad advice? From your phrase, "associating the project with a specific target runtime", I feel you have assumed that there is a project and an IDE involved. Also, your duplicate question link again is an IDE-related question. But, the OP has not talked about any IDE. He could very well be a guy who is new to Java and using a basic text editor. That's why I gave the most generic advice possible. Anyway, it seems to have worked for the OP, considering he has marked it as the right answer. – Shivasubramanian A Jan 24 '13 at 18:37