JBlend Package


Loading into Tcl interpreter:

package require JBlend ?version?

package require JBlend loads the JBLend package into the interpreter. The JBlend package provides an interface for creating and manipulating Java objects via object handles. Object handles are references to Java objects in Tcl. Many of the commands in this package take arguments and return values that are object handles.

When the JBlend package is loaded into a Tcl interpreter, a new namespace named ::java will be created, along with a new JVM instance in Tcl's process space.

You can control some how to start this JVM instance, by setting the global variable tclblend_init before loading the package.
Note that tclblend_init is a list of strings, and each element is passed as an option to the Java Virtual Machine being instantiated (see Example below).
After loading the package, you can inspect all the JVM properties by examining the global array ::java::jvm ( or the old deprecated array ::tcljava).

Example:

lappend ::tclblend_init "-verbose:jni" ;#print debugging messages

For -verbose, the value should be a string with one or more comma separated names (i.e. class,jni). The standard names are: class, gc, jni To see what other options are available, run java -help from the command line.

In addition tclblend_init can have the following values:

help
Print a help message and then stop JVM initialization.
debug
Print out debugging messages when the package is loaded.

To use tclblend_init, set it before loading the java package:

set tclblend:init {}
lappend tclblend_init "-verbose:jni"
lappend tclblend_init "debug"
package require JBlend

parray java::jvm  ;# prints all the currently loaded JVM properties.


Based on TclBlend Copyright © 1994-1998 Sun Microsystems, Inc.
JBlend is Copyright © 2016 - Irrational Numbers.