Bookmark Topic Watch Topic
  • New Topic

Problem to compile servlet and Tomcat

 
Antonio Marcos
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi, I have a problem about the servlets. When try de command line below, the compiler got various errors...

C:\Des\Java\web\proj\beerV1>javac -classpath c:\tomcat\common\lib\servlet-api.ja
r:classes:. -d classes src\com\example\web\BeerSelect.java
src\com\example\web\BeerSelect.java:3: package javax.servlet does not exist
import javax.servlet.*;
^
src\com\example\web\BeerSelect.java:4: package javax.servlet.http does not exist

import javax.servlet.http.*;
^
src\com\example\web\BeerSelect.java:7: cannot find symbol
symbol: class HttpServlet
public class BeerSelect extends HttpServlet {
^
src\com\example\web\BeerSelect.java:8: cannot find symbol
symbol : class HttpServletRequest
location: class com.example.web.BeerSelect
public void doPost(HttpServletRequest request, HttpServletResponse respo
nse)
^
src\com\example\web\BeerSelect.java:8: cannot find symbol
symbol : class HttpServletResponse
location: class com.example.web.BeerSelect
public void doPost(HttpServletRequest request, HttpServletResponse respo
nse)
^
src\com\example\web\BeerSelect.java:9: cannot find symbol
symbol : class ServletException
location: class com.example.web.BeerSelect
throws IOException, ServletException {
^
6 errors

C:\Des\Java\web\proj\beerV1>

My environment:
JAVA_HOME = c:\sun\sdk\jdk
CATALINA_HOME = c:\tomcat
CLASSPATH = .;C:\Sun\SDK\bin;C:\Sun\SDK\jdk\jre\bin;C:\Sun\SDK\jdk\bin;%CATALINA_HOME%\common\lib\servlet-api.jar;%CATALINA_HOME%\common\lib\jsp-api.jar;.;%CLASSPATH%

whats wrong ?

obs.: My JAVA environment is working... then what happen ? could be the Tomcat ? My Tomcat version is 5.5.
Thank's



 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65124
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not post the same question more than once.
 
    Bookmark Topic Watch Topic
  • New Topic