aspose file tools*
The moose likes Tomcat and the fly likes Trouble locating clases Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Trouble locating clases" Watch "Trouble locating clases" New topic
Author

Trouble locating clases

Michael Reynolds
Greenhorn

Joined: Dec 26, 2005
Posts: 12
I have two problems. OK I have a lot of problems but only two are of concern now. I have read and re-read "Headfirst Java" (Excellent refresher BTW). I have loaded and run (verified) Tomcat 5.5 and I can even compile simple (non-import) JAVA code but
1. I can not import anything (java.io, javax.servlet...)
2. I can not for the life of me find instructions for setting up Tomcat to work with JSPs and Servlets. It can not locate (as stated above), the javax.servlet classes. What have I missed??? I think (or thought) I had the CLASSPATH and the PATH environments set (XP BTW) but still no luck locating any of the JAVA classes. Please direct me.
Monica Moncho
Ranch Hand

Joined: Dec 01, 2004
Posts: 31
hello,

I don't know if this will help you because I am coming back to this myself, but I have notes here to copy the servet.jar from tomcat\common\lib to the jre\lib\ext of wherever your jsdk is.
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Moving to the Tomcat forum for expert help...


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Michael Reynolds
Greenhorn

Joined: Dec 26, 2005
Posts: 12
OK, I found the problem with the basic "java...." includes. A typo on my part!. I still can not locate any of the servlet classes though even though the API JARS exist. Where should I place these APIs and what should I add to the environment variables to allow me to import the servlet class and its derivitives?

PS: will the correction then allow me to compile and run servlets and JSP?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61198
    
  66

Originally posted by Monica Moncho:

I don't know if this will help you because I am coming back to this myself, but I have notes here to copy the servet.jar from tomcat\common\lib to the jre\lib\ext of wherever your jsdk is.


No, no, no! Never copy things into the Java distribution. leave the jar where it is and set you compile-time classpath to include it.
[ February 12, 2006: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61198
    
  66

Be sure that the servlet-api.jar file is in your classpath.

If you don't know how to set up the classpath, that's a subject for the beginner Java forum.
Michael Reynolds
Greenhorn

Joined: Dec 26, 2005
Posts: 12
Thank you all for the information. I am only a "newbie" when it comes to JAVA. I will check the classpath and thanks again for the help. One more question though: Why is it so difficult to obtain information regarding JAVA and its tools. Tomcat information is scattered all over the place and never quite seems to answer the question. IBM and SUN information is far more voluminous yet it too fails to answer any question with a straight forward "how to". I have trouble even navigating their sites.. oh well...

Sorry. Just frustrated :-(
Michael Reynolds
Greenhorn

Joined: Dec 26, 2005
Posts: 12
OK, I have the classpath correct (i believe). I included "tomcat5_5/common/lib" which is where the "servlet-api" JAR resides and it still can not locate any "javax.servlet.* or "javax.servlet.http.*" classes. I know that I am missing something but can not for the life of me hit on it. Any thoughts?
Michael Reynolds
Greenhorn

Joined: Dec 26, 2005
Posts: 12
Oh, my "/" are actually facing the correct way. I jump back and forth between Linux and Windows and commonly make that mistake but I just checked again to be certain (phew).

Thanks again for all of the advice. It is much appreciated.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61198
    
  66

Originally posted by Michael Reynolds:
OK, I have the classpath correct (i believe). I included "tomcat5_5/common/lib" which is where the "servlet-api" JAR resides ...


Unlike class files, when you add a jar file to the claspath, you add the jar file itself, not the folder in which it resides.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Trouble locating clases