Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie trying to compile.

Status
Not open for further replies.

mikedaruke

Technical User
Mar 14, 2005
199
0
0
US
Ok looks like I have no packages or classes installed. Something is wrong. I did the whole tomcat install, add all the paths, Jsp pages I see, I try to compile this servlet, from a book ( I am learning) and i get this.

TestingServlet.java:1: package javax.servlet does not exist
import javax.servlet.*;
^
TestingServlet.java:2: package javax.servlet.http does not exist
import javax.servlet.http.*;
^
TestingServlet.java:6: cannot find symbol
symbol: class HttpServlet
public class TestingServlet extends HttpServlet {
^
TestingServlet.java:8: cannot find symbol
symbol : class HttpServletRequest
location: class TestingServlet
public void doGet(HttpServletRequest request,
^
TestingServlet.java:9: cannot find symbol
symbol : class HttpServletResponse
location: class TestingServlet
HttpServletResponse response)
^
TestingServlet.java:10: cannot find symbol
symbol : class ServletException
location: class TestingServlet
throws ServletException, IOException {
^
6 errors

Any help?

 
Set your CLASSPATH to include TOMCAT_HOME/common/lib/servlet-api.jar


--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
I have that in there. Unless I need to reboot

C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\lib\servlet-api.jar;


 
Ok if I run it like this it works.

C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\myApp\WEB-INF\cla
sses>javac -classpath ".;c:\Program Files\Apache Software Foundation\Tomcat 5.5\
common\lib\servlet-api.jar" TestingServlet.java

Where am I supposed to add this to the path? I have XP and i do it by controlpanel,system, advanced, enviroment vars.

I edit the PATH. Any other ones am I supposed to edit?

Java_Home? Or am I supposed to add a path? Please help!

 
If you're compiling from the command line, you should add that jar to the CLASSPATH variable, not PATH.


Cheers,

Dian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top