Hi Roy.
There are two likely causes. First, the .jar file must be created with
the "proper" directory structure. For instance, the jacl.jar file
looks like this.
% jar -tf jacl.jar
tcl/lang/AfterCmd.class
tcl/lang/AppendCmd.class
It looks like you might just be using the java::new command incorrectly.
You would NOT want to do this:
java::new x.y.z.class
Instead, do it like this:
set o [java::new x.y.z]
Or use the really handy import command.
java::import x.y.z
set o [java::new z]
I hope that helps.
Mo Dejong
Red Hat Inc.
On Tue, 14 Mar 2000, Roy Terry wrote:
> Can someome tell me if this is supposed to work?
>
> I've got an .jar file (produced inhouse). jar -t
> can list the classes and jar -x can extract the .class
> file I'm interested in. Problem is I haven't so far
> been able to load a class from the file.
>
> After Package require java
> I say
> set env(TCL_CLASSPATH) ./nameofjar.jar
> Then
> java::new x.y.z.class
> -or-
> java::call x.y.z.class
> -or-
> java::methods x.y.z.class
>
> All fail with complaint that class can't be
> found.
>
> What's missing?
>
> -Roy Terry
----------------------------------------------------------------
The TclJava mailing list is sponsored by Scriptics Corporation.
To subscribe: send mail to [EMAIL PROTECTED]
with the word SUBSCRIBE as the subject.
To unsubscribe: send mail to [EMAIL PROTECTED]
with the word UNSUBSCRIBE as the subject.
To send to the list, send email to '[EMAIL PROTECTED]'.
An archive is available at http://www.mail-archive.com/tcljava@scriptics.com