You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Steven Liu <St...@veritas.com> on 2000/11/01 00:59:34 UTC
Help : can't get java compiling through
Hi, any one can tell me why I cant get the this example compiled out.
code is at tomcat/webapps/examples/WEB-INF/classes/RequestParamExample.java
when I do javac RequestParamExample.java , get following output:
RequestParamExample.java:8: package javax.servlet does not exist
import javax.servlet.*;
^
RequestParamExample.java:9: package javax.servlet.http does not exist
import javax.servlet.http.*;
^
RequestParamExample.java:19: cannot resolve symbol
symbol : class HttpServlet
location: class RequestParamExample
public class RequestParamExample extends HttpServlet {
^
RequestParamExample.java:24: cannot resolve symbol
symbol : class HttpServletRequest
location: class RequestParamExample
public void doGet(HttpServletRequest request,
^
RequestParamExample.java:25: cannot resolve symbol
symbol : class HttpServletResponse
location: class RequestParamExample
HttpServletResponse response)
^
RequestParamExample.java:26: cannot resolve symbol
symbol : class ServletException
location: class RequestParamExample
throws IOException, ServletException
^
RequestParamExample.java:84: cannot resolve symbol
symbol : class HttpServletRequest
location: class RequestParamExample
public void doPost(HttpServletRequest request,
^
RequestParamExample.java:85: cannot resolve symbol
symbol : class HttpServletResponse
location: class RequestParamExample
HttpServletResponse response)
^
RequestParamExample.java:86: cannot resolve symbol
symbol : class ServletException
location: class RequestParamExample
throws IOException, ServletException
^
9 errors
Any reason, I cant import javax.serlet ?
My working env is as following:
Apache 1.3.14
JDK 1.3.0
JSDK is tomcat from
//jakarta.apache.org/builds/tomcat/release/v3.1/src/jakarta-tomcat.tar.Z
Cheers,
steven.liu@veritas.com
_____
|
\_____________________________/o\_____________________________/
\_/
Every once in a while, the boundaries get redefined.
Re: Help : can't get java compiling through
Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Steven Liu wrote:
> Hi, any one can tell me why I cant get the this example compiled out.
> code is at tomcat/webapps/examples/WEB-INF/classes/RequestParamExample.java
> when I do javac RequestParamExample.java , get following output:
>
When you are compiling servlets yourself, you must ensure that the servlet.jar
file that came with Tomcat is visible on your classpath. Assuming that
TOMCAT_HOME points at your Tomcat installation directory, you can do this like
so (all on one line):
javac -classpath $TOMCAT_HOME/lib/servlet.jar:$CLASSPATH
RequestParamExample.java
>
> steven.liu@veritas.com
>
Craig McClanahan
Re: Help : can't get java compiling through
Posted by "Julio Serje (@canada.com)" <js...@home.com>.
Looks really weird. When tomcat is starting it tells you what classpath is
using, and normally it should contain tomcat_home/lib/servlet.jar.
Check that you have servlet.jar in your claspath ( tomcat_home/lib
directory), check permissions (if you are running a unix/linux system) or
your environment space if Win 95/98.
Julio Serje
Calian Tech.
----- Original Message -----
From: To: <to...@jakarta.apache.org>
Sent: Tuesday, October 31, 2000 6:59 PM
Subject: Help : can't get java compiling through
> Hi, any one can tell me why I cant get the this example compiled out.
> code is at
tomcat/webapps/examples/WEB-INF/classes/RequestParamExample.java
> when I do javac RequestParamExample.java , get following output:
>
> RequestParamExample.java:8: package javax.servlet does not exist
> import javax.servlet.*;
> ^
> RequestParamExample.java:9: package javax.servlet.http does not exist
> import javax.servlet.http.*;
> ^
> RequestParamExample.java:19: cannot resolve symbol
> symbol : class HttpServlet
> location: class RequestParamExample
> public class RequestParamExample extends HttpServlet {
> ^
> RequestParamExample.java:24: cannot resolve symbol
> symbol : class HttpServletRequest
> location: class RequestParamExample
> public void doGet(HttpServletRequest request,
> ^
> RequestParamExample.java:25: cannot resolve symbol
> symbol : class HttpServletResponse
> location: class RequestParamExample
> HttpServletResponse response)
> ^
> RequestParamExample.java:26: cannot resolve symbol
> symbol : class ServletException
> location: class RequestParamExample
> throws IOException, ServletException
> ^
> RequestParamExample.java:84: cannot resolve symbol
> symbol : class HttpServletRequest
> location: class RequestParamExample
> public void doPost(HttpServletRequest request,
> ^
> RequestParamExample.java:85: cannot resolve symbol
> symbol : class HttpServletResponse
> location: class RequestParamExample
> HttpServletResponse response)
> ^
> RequestParamExample.java:86: cannot resolve symbol
> symbol : class ServletException
> location: class RequestParamExample
> throws IOException, ServletException
> ^
> 9 errors
>
> Any reason, I cant import javax.serlet ?
>
>
> My working env is as following:
> Apache 1.3.14
> JDK 1.3.0
> JSDK is tomcat from
> //jakarta.apache.org/builds/tomcat/release/v3.1/src/jakarta-tomcat.tar.Z
>
> Cheers,
>
> steven.liu@veritas.com
> _____
> |
> \_____________________________/o\_____________________________/
> \_/
>
> Every once in a while, the boundaries get redefined.