SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Vijitha Kumara wrote:When do you get this error? Show us the stack trace. Have you setup the classpath ? If so how? Try "echo %CLASSPATH%" (on Windows) from command prompt and post the output.
it is compile time error in which it is unable to find the package
SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Anky Gupta wrote:this is the class path
.;C:\Program Files\Java\jre1.6.0_04\lib\ext\QTJava.zip
SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
D:\Prog\MyProject\beerV1>javac -classpath \C:\ProgramFiles\Apache\Tomcat\common\
lib\servlet-api.jar;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:9: cannot find symbol
symbol : class HttpServletRequest
location: class com.example.web.BeerSelect
public void doPost(HttpServletRequest req,HttpServletResponse res) throws IOExce
ption,ServletException
^
src\com\example\web\BeerSelect.java:9: cannot find symbol
symbol : class HttpServletResponse
location: class com.example.web.BeerSelect
public void doPost(HttpServletRequest req,HttpServletResponse res) throws IOExce
ption,ServletException
^
src\com\example\web\BeerSelect.java:9: cannot find symbol
symbol : class ServletException
location: class com.example.web.BeerSelect
public void doPost(HttpServletRequest req,HttpServletResponse res) throws IOExce
ption,ServletException
^
6 errors
SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Anky Gupta wrote:.;C:\Program Files\Java\jre1.6.0_04\lib\ext\QTJava.zip;C:\Program Files\Apache\Tomcat\common\lib
IS this class path okay?
SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." -- Ted Nelson
Don't get me started about those stupid light bulbs. |