The main goal of TJB is to provide the same TclBlend command interface, with a single 'binary' package that can be installed and run on all the most popular platforms (Windows,Linux,MacOS), independently of the JVM installed on the target computer.
This means that - with no need of rebuild - you can install/copy TJB on Win/Linux/Mac, and moreover, once installed, you are also free to change/upgrade the underlyng Tcl or JVM - again, with no need to rebuild TJB .
To achieve this goal TJB lost the TclBlend/Tcljava ability to act as a bidirectional bridge between a JVM and a Tcl interpreter; TJB can be used only in one way, from Tcl to Java and not in the opposite direction. For many Tcl users like me, this is enough.
Changing the true nature of TclBlend/Tcljava, required radical changes on the original TclBlend code, not to mention the completeley redesigned build procedures; hence the need of a fork: TclJBlend .
What you need:
A big little WARNING: Don't mix 32/64 bit applications; Tcl and JVM should be both 32bit or both 64bit.
Once you have all these components, *before launching the Tcl interpreter*, you should add to LD_LIBRARY_PATH the directory containing "jvm.dll" ( or its equivalent "libjvm.so" (Linux) or "libjvm.dylib" (MacOs) ).
Now you are ready to run ..
Set LD_LIBRARY_PATH (in dos-notation or even in unix-notation) and launch Tcl
DOS> set LD_LIBRARY_PATH="c:\MYJRE\bin\client:%LD_LIBRARY_PATH%" DOS> tclsh
then type the following Tcl commands
# Uncomment and adapt the following line if TJB is not placed in a directory # referenced by the auto_path variable. # # lappend auto_path ...where-is-TJB... # package require JBlend # create a Java object ( a java.lang.String ) set x [java::new java.lang.String "Hello Tcl ! I'm a Java String"] # call the "toUpperCase" java-method set res [$x toUpperCase] puts $res ....
Set LD_LIBRARY_PATH and launch Tcl
sh> LD_LIBRARY_PATH=".../jre1.7.0_80/lib/amd64/server;$LD_LIBRARY_PATH" sh> export LD_LIBRARY_PATH sh> tclsh
then type the (same) Tcl commands
# Uncomment and adapt the following line if TJB is not placed in a directory # referenced by the auto_path variable. # # lappend auto_path ...where-is-TJB... # package require JBlend # create a Java Object ( a java.lang.String ) set x [java::new String "Hello Tcl ! I'm a Java String"] set res [$x uppercase] puts $res ....
Note: it is important to set LD_LIBRARY_PATH *before* launching Tcl ; setting env(LD_LIBRARY_PATH) from inside Tcl would be easy, but it doesn't work !
No documentation, yet. Just few quick notes:
cd ...\tclJBlend-devkit ms-build x32 ms-build x64
On Unix (Linux/Mac or Windows+MingW)
cd .../tclJBlend-devkit ./build.sh x32 ./build.sh x64
NOTE: Building on MacOsX is still experimental ..