tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Stacy <cst...@crystaliz.com>
Subject beginner question (really) about how JAVA finds classes when compiling
Date Thu, 13 Apr 2000 20:57:41 GMT
>>>>> On Thu, 13 Apr 2000 14:36:58 -0400, Christopher Stacy ("C") writes:

 C> I am running Tomcat (a few weeks old) (with Apache) on NT.
 C> I am using the default "web.xml" file.
 C> I have a JSP (located in "webapps/mytop/my.jsp") that invokes a bean FOO.Bean.
 C> The bean is being loaded from "webapps/mytop/WEB-INF/classes/FOO/Bean.class".

 C> Now I want the bean to instantiate another class Foo, which is part of the same FOO
package.
 C> The source file "Foo.java" (like "Bean.java") begins with a "package FOO" statement.
 C> I placed "Foo.java" in the same directory (FOO) and compiled it.

 C> However, the following statement in Bean.java will not compile:
 C> 	 Foo f = new Foo();
 C> because it cannot resolve the symbol "Foo".

 C> How do I tell JAVA how to resolve this symbol and make this work?

 C> Both classes are in the same package, so I don't think I need to import anything.
 C> It must be a confusion about where the class files live, or else something even more
basic.

My problem description above could have been a little confusing
(because it's so simple).  The question is really: I am sitting in
a directory named FOO trying to javac a file Bean.java which makes
reference to the class "Foo".  There is a "Foo.java" and "Foo.class"
file sitting in this same directory already.  CLASSPATH includes ".".
Both classes are in the same package FOO.  What else do I need to do?

The problem is presumably unrelated to Tomcat.
(Of course, I still don't realize what the problem is.)


Mime
View raw message