wood burning stoves 2.0*
The moose likes Servlets and the fly likes Package not found error on running servlet ! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Package not found error on running servlet !" Watch "Package not found error on running servlet !" New topic

Package not found error on running servlet !

Ghazala Islam
Ranch Hand

Joined: Nov 22, 2000
Posts: 73
I compile the following servlet in jdk1.3/bin directory
its giving error 'Package javax.servelet does not exist'
and same error for all three import commands.Where is the problem?
The servelet is:
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class HelloWorld2 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>");
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
You have to download the servlet packages from sun's website.

So much trouble in the world -- Bob Marley
Sagar Surana

Joined: Dec 23, 2000
Posts: 21

u have to set the classpath in ur autoexec.bat
set classpath=x:\<server_root>\lib\servlet.jar
if ur using java web server
where x = drive in which u have installed java web server
<server_root> = directory in which web server is installed

Sagar Surana
( +ve attitude)

Sagar Surana<BR>optimist
I agree. Here's the link: http://aspose.com/file-tools
subject: Package not found error on running servlet !
Similar Threads
Servlet HelloWorld problem
Error when compiling servlet.
New to servlets
package javax.servlet. does not exist
How to test my servlet