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 sf.net 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):
|8.4.18||1.6||only 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)|
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)); #else ckalloc((unsigned) (strlen(interp->result) + 1)); #endif #if TCL_MAJOR_VERSION > 8 || \ (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION > 5) strcpy(tPtr->errMsg, Tcl_GetStringResult(interp)); #else strcpy(tPtr->errMsg, interp->result); #endifTest script:
package require java java::import java.net.InetAddress 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-2016I experienced the same fatal errors .. tclblend worked with Tcl 8.4.x, 8.5.x, 8.6.0 and then stopped working.Here is even a simpler way to get a crash (with tcl > 8.6.0)
package require java set jObj [java::new java.lang.Object] puts "jObj is $jObj" ;# --> jObj is java0x1 puts "jObj value is [$jObj toString]" ;# --> jobj value is [email protected] (CRASH with TCL > 8.6.0)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 ... WRONG !! NRE was in 8.6beta and 8.6.0It'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) ?ABU 9-04-2016I submitted a bug (with a fix proposal) to the Tcl-coreSee https://core.tcl.tk/tcl/tktview?name=07d13d99b0 for details.I believe that the crash is due to a change in tclObj.c introduced in 8.6.1. My patched Tcl-8.6.1 (.. 8.6.4) seems to work but of course changes in Tcl-core require a lot of attention.ABU 9-08-2016 * Restored support for TclBlend.Tcl 8.6.6, released on late July 2016, restored support for tclblend. Great !