Subject | Re: [Firebird-Java] OT: classpath and tomcat |
---|---|
Author | Roman Rokytskyy |
Post date | 2004-09-26T13:34:51Z |
> I have class that is using other class User in the same directoryIf your TestSql.java is defined as
>
> WEB-INF/classes$ javac -verbose TestSql.java
>
> ./TestSql.java:6: package User does not exist
> import User.*;
> ^
>
> And is included "." in $CLASSPATH
package User;
public class TestSql {
...
}
then even you compile your class with javac, you have to place it into
WEB-INF/classes/User directory (note, it is case sensitive; also in Java
packages usually are lowercase). However if there is no "package" directive
on the beginning of the class declaration, it is placed in the "default"
package and putting the .class file in WEB-INF/classes is correct.
If the User.java does not have package declaration, it must be placed in the
same directory, but in this case your import is not correct. "import
User.*;" means "import all classes in the User/ directory".
Roman