On Sat, 27 May 2000, Ulf Dittmer wrote:

> Hi-
> 
> I'm trying to port TCLBlend 1.2.6 to the Mac, and maybe
> I'm in way over my head. You can judge from my questions :-)

I would suggest that you start with the 1.3 development version in
the CVS, but it is up to you. The pkgIndex.tcl file was improved
a lot for the  1.3 version, so I think you would be better off
starting with 1.3.
 
> 1) Is the pkgIndex.tcl file necessary? From what I can tell,
> it sets up the paths for TCL and Java to find their respective files.
> On the Mac, TCL and Java find their extensions automatically,
> if put into the proper folders. And on the Mac, the package provide
> statement is also invoked from the library, not from the .tcl file.
> Does the file do anything else?

The pkgIndex.tcl file does a two things (I am looking at the 1.3
version when making these comments).

1. Adds tcljava.jar and tclblend.jar to the CLASSPATH env variable
   if they are not already on the CLASSPATH.

2. Calls the load command with the name of the shared library to
   for tclblend. Under UNIX, it calls "XpUtils::iload" which
   will will call "load libtclblend.so". Under Windows, this
   will call "load tclblend.dll". To get it to work on the Mac
   you will need to fix up the XpUtils::iload command so that
   it knows how to convert the generic pkg name "tclblend"
   to whatever name the mac uses.

You should be able to just set the CLASSPATH by hand and call the
load command directly with the name of the tclblend dll. The
pkgIndex.tcl file can be skipped if you just want to get
things working.

> 2) When executing the line
>     local = (*env)->NewObject(env, java.Interp, java.interpC, lvalue);
> in TclBlend_init in javaCmd.c, I'm getting an UnsatisfiedLinkException.
> I think it's trying to create a tcl.lang.Interp, and invoke the init method
> on it. But that method is declared private, so this call couldn't possibly
> succeed? Am I missing something obvious? (The Exception is not due to
> the library not being found: it is.)

I don't think it has anything to do with the method being private.
This is the JVM's way of telling you that it can not find the native
JNI symbols needed to use a class (tcl.lang.Interp in this case).
I suspect that the Mac JVM is not able to find the tclblend
shared library. The whole shared library thing can get kind of
wacky because both Tcl and the JVM need to be able to locate
shared libraries. On Windows and JDK 1.2 from Sun, you are
required to set the PATH env var to include the directories
where the Sun Java shared libs live along with the dir where
tclblend.dll lives even if you provide the fully qualified
path name to the Tcl load command. There must be something that
works like the LD_LIBRARY_PATH or PATH env variables for the
Mac. You just need to figure out how to set to so that Tcl
and the JVM can find and load the tclblend shared lib.

> Many thanks in advance for any hints what's going wrong.
> Cheers,
> Ulf


good luck
Mo Dejong
Red Hat Inc.

----------------------------------------------------------------
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

Reply via email to