Meaningless Drivel is fun!
The moose likes Servlets and the fly likes New to servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "New to servlets" Watch "New to servlets" New topic

New to servlets

Vaibhav Shridish

Joined: Jun 06, 2002
Posts: 28
I have downloaded jsdk and tomcat
I tried to run the following program
import javax.servlet.*;
import javax.servlet.http.*;
public class HelloWorld extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
PrintWriter out = response.getWriter();
out.println("<title>Hello World!</title>");
out.println("<h1>Hello World!</h1>");
It is showing me an error saying
Package javax.servlet not found.
my javax directory doesnt have servlet directory ...?
Do i need to download javax from somewhere ?
plz let me know ...

Vaibhav Shridish
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

javax.servlet is found in servlet.jar, which should be included with Tomcat.

In order to compile servlets, you need to have servlet.jar in your CLASSPATH. So append the path to this jar (found in CATALINA_HOME/common/lib) to your existing CLASSPATH and you should be fine.

JSDK is also a very old package. Unless by jsdk you meant 'tomcat'. If you've downloaded an actual thing called JSDK, then you can remove it from your system, you don't want it. Tomcat has everything you need.

General question: where do people keep finding updated links to jsdk or jswdk? These are in an archived part of
I agree. Here's the link:
subject: New to servlets
It's not a secret anymore!