This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: define-simple-class and jars on the classpath?
- From: Per Bothner <per at bothner dot com>
- To: Steve Smith <tarka at internode dot on dot net>
- Cc: kawa at sources dot redhat dot com
- Date: Sat, 26 Aug 2006 22:56:56 -0700
- Subject: Re: define-simple-class and jars on the classpath?
- References: <20060827052445.GA1014@lucretia.remote.isay.com.au>
Steve Smith wrote:
The Ant jars are under /usr/share/java, so I've added them all to
CLASSPATH. I know they're fine because I can define the following
java class and compile it:
import org.apache.tools.ant.Task;
public class AntTest extends Task {
}
...
# javac AntTest.java
This works; however if I try to define the equivalent simple-class it
fails:
(define-simple-class <AntTest> (<org.apache.tools.ant.Task>)
)
...
# kawa -C AntTest.scm
(compiling AntTest.scm)
AntTest.scm:3:1: unknown super-type org.apache.tools.ant.Task
One possibility: Kawa uses reflection to "read" the Task class,
so it needs to load the class. I believe javac reads the actual
class file, rather than using reflection.
Now I don't know why this might make a difference. One possibility
is that the Task class depends on other classes not in the classpath.
javac doesn't need to read those, but they're needed when the class
is initialized.
You could also try to add a:
ex.printStackTrace();
in the catch clause in gnu/expr/ClassExp.java where the error
message is emitted.
--
--Per Bothner
per@bothner.com http://per.bothner.com/