Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 44519 invoked from network); 17 Dec 2002 01:27:14 -0000 Received: from exchange.sun.com (HELO nagoya.betaversion.org) (192.18.33.10) by daedalus.apache.org with SMTP; 17 Dec 2002 01:27:14 -0000 Received: (qmail 16705 invoked by uid 97); 17 Dec 2002 01:28:10 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@jakarta.apache.org Received: (qmail 16681 invoked by uid 97); 17 Dec 2002 01:28:09 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 16669 invoked by uid 98); 17 Dec 2002 01:28:09 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Message-ID: From: Patrick Martz To: 'Tomcat Users List' Subject: RE: Tomcat setup question. Date: Mon, 16 Dec 2002 17:26:55 -0800 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Ok here's the current setup I have: 1) The j2sdk installed in C:\j2sdk 2) The j2ee installed in C:\j2ee (because this supposedly contains what I need) 3) Tomcat installed in C:\Program Files\Apache Group\Tomcat 4.1 4) The following environmental variables set: a) J2EE_HOME = C:\j2ee b) JAVA_HOME = C:\j2sdk c) Both C:\j2ee\bin and C:\j2sdk\bin added to PATH. d) TOMCAT_HOME = C:\Program Files\Apache Group\Tomcat 4.1 e) There is no CLASSPATH variable set. I have noted that "C:\j2ee\lib\j2ee.jar" contains the HttpServlet class as does "C:\Program Files\Apache Group\Tomcat 4.1\common\lib\servlet.jar". If I try to compile, my compiler (from Sun) fails to import java.servlet.* and java.servlet.http.*. If I try to add the .jar file the classpath, it still fails to compile. Below is the servlet (it's very simple, I just want to get this thing working!). import java.io.*; import java.util.*; import java.servlet.*; import java.servlet.http.*; public class Test extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { res.setContentType("text/html"); PrintWriter out = res.getWriter(); out.println(""); out.println("Test"); out.println(""); out.println("test"); out.println(""); out.println(""); } } -----Original Message----- From: Peng Tuck Kwok [mailto:pengtuck@makmal.net] Sent: Monday, December 16, 2002 5:10 PM To: Tomcat Users List Subject: Re: Tomcat setup question. Don't panic, just attach a sample servlet that you were trying to compile to the list. I'll have a look at it and try to get it to compile ok? The javac -classpath should work by the way. Patrick Martz wrote: > Thank you for the help. However, I tried that...I added the directory where > servlet.jar is located to the classpath. Once I do that, it no longer > recognizes ANY of the other classes in its own directory, and therefore > cannot make any references to them. I am frankly stumped....and I apologize > for my ignorance but this is all very new to me. > > -----Original Message----- > From: Peng Tuck Kwok [mailto:pengtuck@makmal.net] > Sent: Monday, December 16, 2002 5:00 PM > To: Tomcat Users List > Subject: Re: Tomcat setup question. > > > Tomcat comes with servlet.jar, which has all the classes you need. Or > you can download a copy from Sun Microsystems as well. Just point your > compiler to the servlet.jar or add it to the classpath. > If you unpack the servlet.jar with winzip you'll see what I mean. Plus I > think it is javax.servlet, not java.servlet. > > Patrick Martz wrote: > >>Ok this is exactly my problem. These aren't MY jar files. These are jar >>files that came with Tomcat. Apparently, the standard J2SDK does NOT come >>with the servlet classes that I need to compile java servlets. So > > therefore, > >>when I try to import java.servlet.* it fails miserably. Even the classes >>that come WITH Tomcat itself (for example, HelloWorldExample in the > > examples > >>directory) are not compilable. Therefore, clearly, something needs to be >>done so that the java compiler can find these packages. Exactly what that > > is > >>I do not know and would be very appreciative if anyone could help! >> >>-----Original Message----- >>From: Peng Tuck Kwok [mailto:pengtuck@makmal.net] >>Sent: Monday, December 16, 2002 4:41 PM >>To: Tomcat Users List >>Subject: Re: Tomcat setup question. >> >> >> >> >> >> >> >>>So do I need to add an environmental variable to let my compiler find >> >>these? >> >> >>>Or do I just need to move the .jar files to the right location? How do I >>>know which .jar files are the correct ones to use (as I mentioned, there >> >>are >> >> >>>a number of them that seem to have what I'm looking for)? >> >> >>You can do any of the steps you have suggested yourself or you could >>also just tell the compiler where to find your jars. javac -classpath >>would do the trick >> >> >>-- >>To unsubscribe, e-mail: >> >>For additional commands, e-mail: >> >> >>-- >>To unsubscribe, e-mail: > > > >>For additional commands, e-mail: > > > >> > > > > -- > To unsubscribe, e-mail: > > For additional commands, e-mail: > > > -- > To unsubscribe, e-mail: > For additional commands, e-mail: > > -- To unsubscribe, e-mail: For additional commands, e-mail: -- To unsubscribe, e-mail: For additional commands, e-mail: