[972] in java-interest

home help back first fref pref prev next nref lref last post

Re: Simple Problem - HELP!

daemon@ATHENA.MIT.EDU (Andrew Carlson)
Wed Aug 16 00:29:00 1995

Date: Tue, 15 Aug 1995 11:21:12 +0000
From: andycarlson@attmail.com (Andrew Carlson)
To: iansmith@parc.xerox.com (Ian Smith)
Cc: java-interest@java.sun.com

>>Basically, I can't seem to get javac to see any classes which are defined in
>>source files other than the one being compiled, except that is, for the 
>>classes which come with java. 

>>I have also tried this on the source posted here recently by Doug Lea, which
>>is supposed to be (and probably is) OK.

>>BTW I am using java for NT Alpha 2 on NT 3.5.1

>I had a similar problem. It might help to know that if your 'import '
>statement names packages they are expected to form a dot separated
>path to the class. Example:

>CLASSPATH=/foo/bar

>... in some java code you do ...

>import grik.grak;

>Then the file that must exist and have *already* been compiled is:
>/foo/bar/grik/grak.class

Thanks, that did the trick for Doug's code. You are right that packages must 
be in subdirectories under the location indicated by CLASSPATH. Without 
'import' there seems to be no need to compile the other class first (otherwise
circular references would be kind of tough). This may be in the docs 
somewhere, but I haven't found it.

I still can't compile stuff located in the CLASSPATH directory which contains 
no package statements, but at least by adding package statements and moving 
the files (which is probably good practice anyway), I have a way forward.

Thanks again, Andy
----------------------------------------------------------------------
Andy Carlson. AT&T ISTEL                Tel: +44 1527 494358
E-Mail: andycarlson@attmail.com         Fax: +44 1527 494318
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post