Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-20-2008, 09:36 AM
Member
 
Join Date: May 2008
Posts: 7
srinivaspuvvala is on a distinguished road
help me to set classpath
I am new to java .
i have tomcat 5.5.

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


public class SecondEx 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("<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>");
}

when i am trying to excute this program i got errors like


package javax.servlet does not exist

package javax.servlet.http does not exist

cannot find symbol class HttpServletRequest
cannot find symbol class HttpServletResponse
cannot find symbol class ServletException

could any body help me to fix this errors.

i have tried classpaths like

CLASSPATH :C:\Program Files\Apache Software Foundation\Tomcat 5.5\server\lib

and

C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\lib

but it did n0t work.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-21-2008, 08:02 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,035
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga

Yep, class path error.

Try this on the command prompt from the working folder.

Code:
set classpath=c:\Program Files\Apache Software Foundation\Tomcat 5.5\lib\servlet.jar
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
(Close on September 4, 2008)

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Classpath Preethi New To Java 5 06-20-2008 10:00 AM
Set classPath? rgbosque New To Java 3 02-07-2008 03:14 PM
GNU Classpath 0.96.1 JavaBean Java Announcements 0 11-01-2007 05:14 PM
GNU Classpath 0.96 JavaBean Java Announcements 0 10-16-2007 07:35 PM
Doubt with classpath fred New To Java 1 07-24-2007 02:58 AM


All times are GMT +3. The time now is 10:38 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org