Subject | Re: [Firebird-Java] OT: classpath and tomcat |
---|---|
Author | marius popa |
Post date | 2004-09-26T13:56:01Z |
Roman Rokytskyy wrote:
with old version it worked /opt/jdk1.3.1_13/bin/javac vs the new version
(j2sdk1.4.2_02)
ps:
now that is strange ...
>>I have class that is using other class User in the same directoryOk thanks for all the help it seems it was java version on my machine
>>
>>WEB-INF/classes$ javac -verbose TestSql.java
>>
>>./TestSql.java:6: package User does not exist
>>import User.*;
>>^
>>
>>And is included "." in $CLASSPATH
>
>
> If your TestSql.java is defined as
>
> 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
with old version it worked /opt/jdk1.3.1_13/bin/javac vs the new version
(j2sdk1.4.2_02)
ps:
now that is strange ...