netBeans can't find classes
Christopher Rued
c.rued at xsb.com
Tue Sep 21 11:45:17 PDT 2004
Jason Dusek wrote:
> I'm sorry, there was an error in the first line of my message that
> didn't make any sense. Rewritten, the message is:
>
> I am unable to compile a class that depends on another class within
> the same directory when using netBeans, but if I use javac then I can
> compile okay.
>
> The directory I'm working in looks like this:
>
> -rw-rw-r-- 1 jsn jsn 1672 Sep 20 10:52 Matrix.java
> -rw-rw-r-- 1 jsn jsn 367 Sep 17 20:58 MatrixInterface.java
> -rw-rw-r-- 1 jsn jsn 3157 Sep 21 10:59 MatrixMultiplication.java
> -rw-rw-r-- 1 jsn jsn 4029 Sep 20 09:04 OldSparseMatrix.java
> -rw-rw-r-- 1 jsn jsn 2388 Sep 20 10:11 SparseMatrix.java
>
> And the error that I get when I compile Matrix.java in netBeans 3.6 is:
>
> /home/jsn/.public-html/Classes/22c:021/Project_1/Matrix.java [13:1]
> cannot resolve symbol
> symbol : class MatrixInterface
> location: class Matrix
> public class Matrix implements MatrixInterface
> ^
> 1 error
> Errors compiling Matrix.
>
The most common reason for this sort of thing is that you have
incorrectly mounted your source in NetBeans.
If you mount the directory:
/home/jsn/.public-html/Classes/22c:021/Project_1
and try to compile from within NetBeans, this should solve the problem.
The reason for the issue is that each directory you have mounted is
added to your classpath. To NetBeans, your
interface's fully-qualified name probably looks something like
"Project_1.MatrixInterface" (the class MatrixInterface in the
Project_1 package), which is different than "MatrixInterface" (the class
MatrixInterface in the default package).
If you correct your mount point (i.e., classpath), all should be well.
Hope that helps.
--Chris
More information about the freebsd-java
mailing list