Meaningless Drivel is fun!*
The moose likes Servlets and the fly likes Problem to compile servlet and Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply locked New topic
Author

Problem to compile servlet and Tomcat

Antonio Marcos
Greenhorn

Joined: May 31, 2009
Posts: 3
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





Antonio Marcos Fernandes
System Analyst - Brazil
I believe at the force inside me...


Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61606
    
  67

Please do not post the same question more than once.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem to compile servlet and Tomcat