Version 39 of Building TclBlend with msys_mingw

Updated 2004-07-19 07:41:10

Sept 22, 2003 CB

Inspired by Building JACL with msys I try to do my part to advance the cause of TclJava.

In this page I will try to relate some (hopefully) useful information for any other newish tclers who might want to try TclBlend on Windows. (Based on my experience trying to get it working)

These steps are only for TclBlend 1.3.1. Hopefully they will be slightly smoother for 1.3.2

Steps:

First (Downloads):

  1. Go to http://sourceforge.net/project/showfiles.php?group_id=10894
  2. Download the most recent version of msys_mingw (should be at the top)
  3. Download tcl844-src.zip
  4. Download tk844-src.zip
  5. Download thread252.zip (down near the bottom)
  6. Go to http://sourceforge.net/project/showfiles.php?group_id=13005
  7. Download tclBlend131.zip
  8. Download jacl131.zip while you're at it if you want to.
  9. Download libjvm.dll.a from here [L1 ] and save it someplace you won't forget. There is a problem with linking to the jvm. This file solves it (it comes from Mo Dejong) if you don't have it, ./configure will DIE when building tclBlend.

Second (Unzip):

  1. Unzip msys_mingw.zip to whereever you want to keep it (I put mine on the root of the C drive.) It will create a top level directory called msys and a directory tree underneath containing all necessary files for msys/mingw operation.
  2. Create a src directory somewhere convenient. I used /src (C:\msys\src if looking at it from outside msys.)
  3. Unzip tcl844-src.zip into the src directory
  4. Unzip tk844-src.zip into the src directory
  5. Unzip thread252.zip into the src directory
  6. Unzip tclBlend131.zip into the src directory
  7. copy the libjvm.dll.a file that you downloaded earlier to src/tclBlend1.3.1/win (you MUST do this)
  8. Unzip jacl131.zip into into the src directory (if desired)

Third (Install JDK):

  1. Go to java.sun.com
  2. download/install desired jdk/j2sdk to somewhere either in the msys directory tree or wherever else desired.

Fourth (Tell msys where JDK is located - from Building JACL with msys):

1. Create a directory called profile.d in the /etc directory

 mkdir /etc/profile.d

2. Take the following script (see Building JACL with msys) and modify it to match your jdk install directory

  JDK=/opt/j2sdk1.4.2  <CHANGE THIS LINE TO MATCH YOUR ACTUAL INSTALL DIRECTORY>
  JRE=$JDK/jre

  if [ -d $JDK ]; then
     PATH=$PATH:$JDK/bin
     CLASSPATH=.:$JDK/lib/tools.jar:$JDK/lib/dt.jar:$JRE/lib/rt.jar:$JRE/lib/jsse.jar:$JRE/lib/jce.jar
     export PATH CLASSPATH
  fi

3. Save the script as jdk.sh in the directory /etc/profile.d that you just created

Fifth (Build Tcl):

  1. cd to src/tcl8.4.4/win
  2. ./configure --enable-threads
  3. make
  4. make install

Sixth (Build Tk):

  1. cd to src/tk8.4.4/win
  2. ./configure --enable-threads --with-tcl=<path to src>/src/tcl8.4.4/win
  3. make
  4. make install

Seventh (Build threads package):

  1. cd to src/thread25
  2. ./configure --enable-threads --with-tcl=<path to src>/src/tcl8.4.4/win
  3. make
  4. make install

Eighth:

  1. cd to src/tclBlend1.3.1/win (resp. src/tclBlend1.3.1)
  2. ./configure --with-tcl=<path to src>/src/tcl8.4.4/win --with-jdk=<jdk install directory> --with-threads=<path to src>/src/thread25/win
  3. make
  4. make install

NOTE: It is simplest if you refer to the jdk directory with its full path name. To refer to the C: drive you start the path in msys with /c/ so if the jdk were in C:\jdk131 the configure directive would be --with-jdk=/c/jdk131

Ninth (Build JACL - if desired) See also Building JACL with msys:

  1. cd to src/jacl1.3.1/win
  2. ./configure --prefix=<desired dest. directory> --with-jdk=<jdk install dir>
  3. make
  4. make install

NOTE: At this point Everything is installed and should be working. You will find it all in /local/bin (C:\msys\local\bin). (You will find JACL wherever you told it to install.) Run TclBlend by starting the jtclsh or jwish scripts. They will set up all the environment variables you need and then start the interpreter. These must be run in msys, not under a regular cmd prompt.

Comments: You will almost certainly want to get tkcon for interactive use since msys does weird things to the tcl shell (it doesn't display toplevel responses from the shell).

Run tkcon as:

 jwish tkcon.tcl

Once in tkcon do:

 package require java

Updated by Patrick Finnegan 03/06/2004. EM: [email protected].

Great set of instructions. Helped me get TclBlend running on Windows. However there may be a couple of minor discrepancies. I changed the following.

1. Step 1.

I did not install libjvm.ddl and TclBlend seems to work fine.

2. Step 8.

replace "cd to src/tclBlend1.3.1/win (resp. src/tclBlend1.3.1)" with "cd to src/tclBlend1.3.1"

replace "--with-threads=<path to src>/src/thread25/win" with "--with-thread=<path to src>/src/thread25"

3. Step 9.

Replace "cd to src/jacl1.3.1/win" with "cd to src/jacl1.3.1"

!!! Rather crude method of running tclblend directly from the windows command shell. The WebSphere classpath is not required. I was testing the embedded WebSphere jmx bean scripting framework. !!!:

Finally got tclblend to work from the windows shell. Just needed to get the classpaths and path variables correct. Details in this sample script that runs gridDemo.


@echo off

echo *********************************************************** echo * Set classpaths for tclblend execution under Windows XP. echo * Run gridDemo example using tclBlend1.3.1 and IBM JDK 1.3 echo ***********************************************************

setlocal

PUSHD C:\msys\src\tclBlend1.3.1\demos\gridDemo

set JAVA_LIB_RUNTIME_PATH=C:\IBM\Java13\bin set JAVA_LIB_RUNTIME_PATH=%JAVA_LIB_RUNTIME_PATH%;C:\IBM\Java13\jre\bin set JAVA_LIB_RUNTIME_PATH=%JAVA_LIB_RUNTIME_PATH%;C:\IBM\Java13\jre\bin\classic set JAVA_LIB_RUNTIME_PATH=%JAVA_LIB_RUNTIME_PATH%;C:\msys\local\lib\tcljava1.3.1

set PATH=%JAVA_LIB_RUNTIME_PATH%;%PATH%

set JAVA_CLASSPATH=C:\IBM\Java13\lib\tools.jar set JAVA_CLASSPATH=%JAVA_CLASSPATH%;C:\IBM\Java13\lib\dt.jar set JAVA_CLASSPATH=%JAVA_CLASSPATH%;C:\IBM\Java13\jre\lib\rt.jar set JAVA_CLASSPATH=%JAVA_CLASSPATH%;C:\IBM\Java13\jre\lib\jsse.jar: set JAVA_CLASSPATH=%JAVA_CLASSPATH%;C:\IBM\Java13\jre\lib\jce.jar set JAVA_CLASSPATH=%JAVA_CLASSPATH%;C:\msys\local\lib\tcljava1.3.1 set JAVA_CLASSPATH=%JAVA_CLASSPATH%;C:\msys\local\lib\tcljava1.3.1\tclblend.jar set JAVA_CLASSPATH=%JAVA_CLASSPATH%;C:\msys\local\lib\tcljava1.3.1\tcljava.jar set JAVA_CLASSPATH=%JAVA_CLASSPATH%;C:\msys\src\tclBlend1.3.1\demos\gluepkg

set JAVA_CLASSPATH=%JAVA_CLASSPATH%;C:\IBM\WebSphere51\AppServer\lib\admin.jar set JAVA_CLASSPATH=%JAVA_CLASSPATH%;C:\IBM\WebSphere51\AppServer\lib\wasjmx.jar set JAVA_CLASSPATH=%JAVA_CLASSPATH%;C:\IBM\WebSphere51\AppServer\lib\namingclient.jar set JAVA_CLASSPATH=%JAVA_CLASSPATH%;C:\IBM\WebSphere51\AppServer\lib\txClientPrivate.jar set JAVA_CLASSPATH=%JAVA_CLASSPATH%;C:\IBM\WebSphere51\AppServer\properties set JAVA_CLASSPATH=%JAVA_CLASSPATH%;C:\temp\servermanager.jar

set CLASSPATH=%JAVA_CLASSPATH%

set TCLLIBPATH=C:\msys\local\lib

echo . echo %TCLLIBPATH% echo . echo %path% echo . echo %CLASSPATH% echo .

echo call C:\msys\local\bin\wish84 C:\msys\src\tclBlend1.3.1\demos\gridDemo\gridDemo.tcl

call C:\msys\local\bin\wish84 C:\msys\src\tclBlend1.3.1\demos\gridDemo\gridDemo.tcl

POPD C:\msys\src\tclBlend1.3.1\demos\gridDemo

endlocal