You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by S M <iw...@yahoo.com> on 2005/04/12 22:03:30 UTC

class path

Hi all,
I am a first time user of Tomcat.
I am able to see the Tomcat default page on http://localhost:8080/index.jsp
Now, I want to compile HelloWorld.java using JDK 1.4, the program does not compile and fails with the following log
-----------------------------------------------------------------------
C:\javacode>javac HelloWorld.java
HelloWorld.java:2: package javax.servlet does not exist
import javax.servlet.*;
^
HelloWorld.java:3: package javax.servlet.http does not exist
import javax.servlet.http.*;
^
HelloWorld.java:5: cannot resolve symbol
symbol  : class HttpServlet
location: class HelloWorld
public class HelloWorld extends HttpServlet {
                                ^
HelloWorld.java:7: cannot resolve symbol
symbol  : class HttpServletRequest
location: class HelloWorld
public void service(HttpServletRequest request, HttpServletResponse response) th
rows ServletException, IOException {
                    ^
HelloWorld.java:7: cannot resolve symbol
symbol  : class HttpServletResponse
location: class HelloWorld
public void service(HttpServletRequest request, HttpServletResponse response) th
rows ServletException, IOException {
                                                ^
HelloWorld.java:7: cannot resolve symbol
symbol  : class ServletException
location: class HelloWorld
public void service(HttpServletRequest request, HttpServletResponse response) th
rows ServletException, IOException {
 
     ^
6 errors
-------------------------------------------------------------------------------
as it is not able to locate the servlet pakages.
I have set the class_path as ".;C:\javacode;%CATALINA_HOME%;%CATALINA_HOME%\common\lib\servlet.jar;%J2EE_HOME%\lib\j2ee.jar;"
where ";C:\javacode" had the source code.
 
Please help to get this compiled.
 
Thanks in advance
S.




---------------------------------
  Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now

Re: class path

Posted by Larry Meadors <la...@gmail.com>.
*http://tinyurl.com/6t89b*

On Apr 12, 2005 2:03 PM, S M <iw...@yahoo.com> wrote:
> 
> Hi all,
> I am a first time user of Tomcat.
> I am able to see the Tomcat default page on 
> http://localhost:8080/index.jsp
> Now, I want to compile HelloWorld.java using JDK 1.4, the program does not 
> compile and fails with the following log
> -----------------------------------------------------------------------
> C:\javacode>javac HelloWorld.java
> HelloWorld.java:2: package javax.servlet does not exist
> import javax.servlet.*;
> ^
> HelloWorld.java:3: package javax.servlet.http does not exist
> import javax.servlet.http.*;
> ^
> HelloWorld.java:5: cannot resolve symbol
> symbol : class HttpServlet
> location: class HelloWorld
> public class HelloWorld extends HttpServlet {
> ^
> HelloWorld.java:7: cannot resolve symbol
> symbol : class HttpServletRequest
> location: class HelloWorld
> public void service(HttpServletRequest request, HttpServletResponse 
> response) th
> rows ServletException, IOException {
> ^
> HelloWorld.java:7: cannot resolve symbol
> symbol : class HttpServletResponse
> location: class HelloWorld
> public void service(HttpServletRequest request, HttpServletResponse 
> response) th
> rows ServletException, IOException {
> ^
> HelloWorld.java:7: cannot resolve symbol
> symbol : class ServletException
> location: class HelloWorld
> public void service(HttpServletRequest request, HttpServletResponse 
> response) th
> rows ServletException, IOException {
> 
> ^
> 6 errors
> 
> -------------------------------------------------------------------------------
> as it is not able to locate the servlet pakages.
> I have set the class_path as 
> ".;C:\javacode;%CATALINA_HOME%;%CATALINA_HOME%\common\lib\servlet.jar;%J2EE_HOME%\lib\j2ee.jar;"
> where ";C:\javacode" had the source code.
> 
> Please help to get this compiled.
> 
> Thanks in advance
> S.
> 
> 
> ---------------------------------
> Yahoo! Messenger - Communicate instantly..."Ping" your friends today! 
> Download Messenger Now
>

Re: class path

Posted by Steve Ochani <oc...@ncc.edu>.
Hi,

Did you set class_path or CLASSPATH ?

try running a prompt and typing

echo %CLASSPATH%

and see if you get actual directory listings of everything you mentioned inlcuding the 
servlet.jar

-Steve O.


On 12 Apr 2005 at 21:03, S M wrote:

> I have set the class_path as ".;C:\javacode;%CATALINA_HOME%;%CATALINA_HOME%\common\lib\servlet.jar;%J2EE_HOME%\lib\j2ee.jar;"
> where ";C:\javacode" had the source code.


«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»
Education is what remains after one has forgotten everything he
learned in school. -Albert Einstein 

Steve O.
http://www.steveo.us

New pics: B17G and B24
http://www.steveo.us/B17-B24/

B17G WWII Bomber "Yankee Lady" Flight I took
http://www.steveo.us/b17ride

SUNY NCC MATH/COMPUTER
http://www.matcmp.ncc.edu

SUNY NCC Physical Sciences Dept.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org