Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Problem to compile servlet and Tomcat

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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



 
Sheriff
Posts: 67590
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please do not post the same question more than once.
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic