Version 24 of TclBlend

Updated 2016-02-24 16:37:09 by ABU is the home of Tcl Blend. Tcl Blend is a Tcl package that provides access to Java classes from Tcl. Tcl Blend is implemented using JNI. Tcl Blend is production ready software, it is stable enough to be used in production systems on a daily basis.

Jacl and TclBlend are both implementations that make it easy to use Tcl scripting on the Java platform. The Tcl/Java project provides mailing lists [L1 ], online documentation [L2 ], and a bug reporting interface [L3 ].

Links to a number of Jacl and Tcl Blend related articles are also available [L4 ].

For help building Jacl under Windows, see Building TclBlend with msys_mingw.

LV The notes that reside in the tclblend cvs repository seem to indicate that the current incarnation of tclblend works with Tcl 8.4.13, Thread 2.6.3 or greater and JDK 1.4 .

During April 2008, an announcement was made that the TclBlend 1.4.1 release was available online at the project sight..

Ed Hume I've been able to build tclblend 1.4.1 on a 32bit Linux system with "make test" results as follows (all builds using Thread 2.6.5):

Tcl version jdkresult
8.4.18 1.5ok
8.4.18 1.6only one test failure, JavaImportCmd-2.8 but the test commands work if entered
interactively so this is likely timing and thread related
(there are other test failures that are explained by jdk changes and are not errors) case case

Something is very wrong with using Tcl 8.5 and Tclblend - the first tests to fail are related to setting errorCode or errorInfo results in the interpreter, but there are many errors and segfaults. I am hoping someone who is familiar with TclBlend and 8.4 to 8.5 internal changes may shed some light on the subject.

I test TclBlend 1.4.1 and Tcl 8.6.x on 32-bit Windows platform, and apply patch Compile/Run against Tcl 8.6 . Using Building TclBlend with msys_mingw to build TclBlend and test.

For TIP 330, I also modified src\native\javaInterp.c:

        #if TCL_MAJOR_VERSION > 8 || \
           (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION > 5)
            ckalloc((unsigned) (strlen(Tcl_GetStringResult(interp)) + 1));
            ckalloc((unsigned) (strlen(interp->result) + 1));
        #if TCL_MAJOR_VERSION > 8 || \
           (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION > 5)
        strcpy(tPtr->errMsg, Tcl_GetStringResult(interp));
        strcpy(tPtr->errMsg, interp->result);

Test script:

package require java
puts "My IP Address is: [ [ java::call InetAddress getLocalHost ] getHostAddress ] "

Tcl 8.6.0 can execute test script correctly. However, Tcl 8.6.1 or above version fail when TclBlend try to invoke a Java method.
Note: I also test Tcl 8.5.18, can execute test script correctly.

ABU 24-02-2016

I experienced the same fatal errors .. tclblend worked with Tcl 8.4.x, 8.5.x, 8.6.0 and then stopped working.

I may be wrong, but my guess is that Tcl 8.6.1 introduced a major change with the Non-Recursive Engine (it was not present in (8.6beta)), so all the intricated (to me) stuff about the reference-counting should be reviewed ...

It's a pity; I have a 'stubbed' tclblend that can work from Tcl 8.4 to Tcl 8.6.0 . I know that 'stubbed' TclBlend can be used only in one way (from Tcl to Java and not in the opposite direction), and this worked perfectly for calling complex Java packages (itextPdf, BouncyCastle crypto, ...) .. up to Tcl 8.6.0.

Up to now, my only solution is to distribute my apps with an old TclKit support. Does anyone knows some alternatives for connecting a Tcl interpreter to a JavaMachine ( .. I don't need the opposite direction) ?

See also