Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

errors!!

 
kumar nagur
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai guys,
I have my java in C:\s1studio_jdk\j2sdk1.4.1_02
java and javac are working fine.
I have my tomcat in c
when i tried to compile the program I am getting the following errors.
my program is in first folder.
so,
C:\>cd first
C:\first>javac HelloWorld11.java
HelloWorld11.java:4: package javax.servlet does not exist
import javax.servlet.*;
^
HelloWorld11.java:5: package javax.servlet.http does not exist
import javax.servlet.http.*;
^
HelloWorld11.java:7: cannot resolve symbol
symbol : class HttpServlet
location: class HelloWorld11
public class HelloWorld11 extends HttpServlet {
^
HelloWorld11.java:9: cannot resolve symbol
symbol : class HttpServletRequest
location: class HelloWorld11
public void doGet(HttpServletRequest request, HttpServletResponse response)
^
HelloWorld11.java:9: cannot resolve symbol
symbol : class HttpServletResponse
location: class HelloWorld11
public void doGet(HttpServletRequest request, HttpServletResponse response)
^
HelloWorld11.java:10: cannot resolve symbol
symbol : class ServletException
location: class HelloWorld11
throws IOException, ServletException
^
6 errors
 
Sunil Karumuri
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add servlet.jar to the classpath.
It should be under <TOMCAT_HOME>\common\lib
The servlet API is not part of standard J2SE.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic