This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: define-simple-class and jars on the classpath?


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]