Newbie : How to compile

Alexandre Petit-Bianco apbianco@cygnus.com
Sat Jun 23 08:07:00 GMT 2001


Martín Pérez Mariñán writes:
> When I try to compile this file, it seems that it doesn't find the
> NoTerminal.o and Simbolo.o files.

It's actually looking for the Java files themselves. Make sure the
compiler knows where to look for source files. For example, I could
reproduce an error similar to the one you saw by doing:
 apbianco@venonat[~/tmp/O]: cat ../B.java 
 class B {A foo(){return null;}}
 apbianco@venonat[~/tmp/O]: cat ../A.java 
 class A {}
 apbianco@venonat[~/tmp/O]: gcj -c ../A.java 
 apbianco@venonat[~/tmp/O]: gcj -c ../B.java 
 ../B.java:1: Type `A' not found in the declaration of the return type of method `foo'.
 class B {A foo(){return null;}}
 ^
 1 error
 apbianco@venonat[~/tmp/O]: CLASSPATH="/home/apbianco/tmp" gcj -c ../B.java 
As you can see, setting CLASSPATH properly fixes my problem.
./A


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /