Results 1 to 4 of 4
Thread: help me to set classpath
- 05-20-2008, 08:36 AM #1
Member
- Join Date
- May 2008
- Posts
- 7
- Rep Power
- 0
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.
- 05-21-2008, 07:02 AM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Yep, class path error.
Try this on the command prompt from the working folder.
Java Code:set classpath=c:\Program Files\Apache Software Foundation\Tomcat 5.5\lib\servlet.jar
- 01-18-2009, 06:45 PM #3
Member
- Join Date
- Jan 2009
- Posts
- 8
- Rep Power
- 0
Greetings
Hello Java Forum.
Can u help me find the javax.servlet package in jdk1.6
- 01-18-2009, 07:13 PM #4
The servlet related packages are part of Tomcat. Rather than fussing with the classpath, put JAR files in /common/lib. These JAR's are automatically added to the application classpath. Note that Tomcat separates the server from the applications, which is why you may need to copy some of its JAR's.
I don't remember the names of the JAR's...
Similar Threads
-
Classpath
By Preethi in forum New To JavaReplies: 5Last Post: 06-20-2008, 09:00 AM -
Set classPath?
By rgbosque in forum New To JavaReplies: 3Last Post: 02-07-2008, 02:14 PM -
GNU Classpath 0.96.1
By JavaBean in forum Java SoftwareReplies: 0Last Post: 11-01-2007, 04:14 PM -
GNU Classpath 0.96
By JavaBean in forum Java SoftwareReplies: 0Last Post: 10-16-2007, 06:35 PM -
Doubt with classpath
By fred in forum New To JavaReplies: 1Last Post: 07-24-2007, 01:58 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks