Jacl

To use Jacl, we need our classpath to contain the Jacl classes instead of the Tcl Blend classes. These are contained in the file jacl.jar in the Jacl installation directory. On Windows, my CLASSPATH looks like this:
.;c:\java;c:\tools\jacl\jacl.jar
and this for Solaris:
.:/users/johnr/java:/opt/jacl1.0/jacl.jar
Bogon alert!
Make sure you remove tclblend.jar from your classpath! Jacl and Tcl Blend some common classes, but others are implemented differently for the two products, so Jacl will be unhappy if it has the wrong classes. This is one of the reasons why we recommend (for general use) using wrapper scripts to set CLASSPATH.

To start an interactive Jacl console, start Java on the Jacl shell class:

  > java tcl.lang.Shell
(In Windows NT, start Jacl using the JACL.BAT file, or by selecting the "Jacl Shell" entry from the Start menu.) If all is well, you will get a console into which you can type Tcl commands. All of the Tcl command set is available in Jacl, as well as the Java commands we have covered so far in this tutorial. Similarly, all of the examples in this tutorial that run in tclsh will run unchanged in Jacl. (This includes the examples that create and load our own Java classes.) You might like to try re-running some earlier parts of the tutorial in Jacl to experiment with it.
Bogon alert!
If you happen to be using the Cygwin utilities on Windows, the Jacl shell does not read input when started from bash.

In the following sections, we'll show some of the uses we have found for Jacl. Even without Tk, Jacl is an incredibly handy utility to have at your disposal for working with Java code. Here is a list of what we think are the relative advantages of Jacl and Tcl Blend.

Advantages of Jacl

Disadvantages of Jacl