[jcifs] I have forgotten how to compile Java code.

David D. Kilzer ddkilzer at kilzer.net
Thu Aug 12 05:06:44 GMT 2004

The classpath points to where the *.class files are located.  Unless
you've compiled ndr/NdrLong.java into ndr/NdrLong.class relative to the
current directory (.), javac won't be happy when you compile
NetShareEnumAll.java.  (It won't find NdrLong.class if it's in the
current directory because it should be found under a directory called
"ndr" from the current directory.)

You've also done "import ndr.NdrLong;" inside NetShareEnumAll.java,


On Thu, Aug 12, 2004 at 12:54:37AM -0400, Michael B Allen wrote:

> Ok, I think I've been using Ant for so long I've forgotten how to basic
> stuff.
> I have a class file in an ndr subdirectory:
> $ cat ndr/NdrLong.java 
> package ndr;
> public class NdrLong extends NdrObject {
> 	public int value;
> ...
> If I do javac ndr/NdrLong.java all goes well. But if I try to compile
> another class against those classes I get an error:
> $ javac -verbose -classpath . NetShareEnumAll.java
> [parsing started NetShareEnumAll.java]
> [parsing completed 181ms]
> [loading /usr/local/j2sdk1.4.1_02/jre/lib/rt.jar(java/lang/Object.class)]
> [loading /usr/local/j2sdk1.4.1_02/jre/lib/rt.jar(java/lang/String.class)]
> NetShareEnumAll.java:9: cannot resolve symbol
> symbol  : class NdrLong 
> location: class NetShareEnumAll
>     NdrLong level;
>     ^
> NetShareEnumAll.java:10: cannot resolve symbol
> symbol  : class NdrObject 
> location: class NetShareEnumAll
>     NdrObject info;
>     ^
> So what in the world am I doing wrong here? I think I need to break out the
> "How to Program" book.
> Mike
> -- 
> Greedo shoots first? Not in my Star Wars.

More information about the jcifs mailing list