Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > Servlets
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Servlets section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 26th, 2004, 05:44 AM
Jil Jil is offline
Registered User
 
Join Date: May 2004
Location: , , Sri Lanka.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default package javax.servlet does not exist ...HELP

Hi,
Im new to servlets.
When I tryed to compile this simple servlet,

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class HelloWorld extends HttpServlet {

public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<body>");
out.println("<head>");
out.println("<title>Hello World!</title>");
out.println("</head>");
out.println("<body>");
out.println("<h1>Hello World!</h1>");
out.println("</body>");
out.println("</html>");
}
}

it gave me the error->

Im using
j2sdk1.4.0
Tomcat4.1
CLASSPATH=C:\Tomcat4.1\common\lib\servlet.jar
Whats wrong with this..
I went through the web befor submit this,there were plenty of occurences of the same problem but the answers were same as "Check your classpath" for most of the times.

Pls help me on this.
Thanx in advance for any help.
best regs,
Jil.


Reply With Quote
  #2 (permalink)  
Old May 27th, 2004, 01:48 PM
Registered User
 
Join Date: May 2004
Location: Chattanooga, TN, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default


I had this problem as well. The problem can be with your operating environment CLASSPATH. One way to force your classpath is when you use the javac command. Specify your classpath as follows to see if it will work.

javac -classpath
 .:/webserver/jakarta/common/lib/servlet.jar:$CLASSPATH myfile.java

If this works below then you need to check your System Environment CLASSPATH setting.
Reply With Quote
  #3 (permalink)  
Old July 29th, 2004, 07:25 AM
Friend of Wrox
 
Join Date: Jul 2004
Location: , , India.
Posts: 345
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to gokul_blr Send a message via Yahoo to gokul_blr
Default

If you are using IDE, check the classpath and include the file

/webserver/jakarta/common/lib/servlet.jar

Reply With Quote
  #4 (permalink)  
Old September 12th, 2004, 03:58 PM
Friend of Wrox
 
Join Date: Jul 2004
Location: , , .
Posts: 204
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Alternatively, if your compiler allows you to add references, add a refereces to \common\conf\servlet-api.jar and \common\conf\jsp-api.jar

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
javax.servlet.ServletException: Exception creating frozen84 Servlets 9 January 29th, 2007 09:13 AM
Package javax.servlet.jsp does not exist wottt JSP Basics 5 January 17th, 2007 06:37 AM
javax.servlet gauravchhabra9111 Servlets 1 January 19th, 2005 03:14 AM
javax.servlet problem anupamda JSP Basics 2 June 23rd, 2004 09:59 PM
package org.xml does not exist?? CFerthorney J2EE 1 May 10th, 2004 05:26 PM



All times are GMT -4. The time now is 01:53 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.