Places to go:
Sun's Tcl/Java
interface, available at ftp://ftp.sunlabs.com/pub/tcl/tcljava0.4.tar.gz
can be used to create a shared library that is loaded by the Java byte
interpreter. This shared library has Java classes that allow the user
to evaluate Tcl commands. We created a GNU autoconf
file
that allows tcljava to be easily configured.
We are particularly interested in combining Itcl and Java for use in the Tycho project.
--enable-shared
option.
tcljava0.4a
), or
grab the original Tcljava interfaceftp://ftp.sunlabs.com/pub/tcl/tcljava0.4.tar.gz
from Sun and then patch it with
the patch below.
tcljava0.4a
, then skip to step 5 below.
tcljava0.4
sources, then
grab the tcljava0.4a.patch
,
file which contains the following new files:
configure.in
configure
makefile.in
configure
uses to create makefile
makefile.vc
TclTest.java
sun.tools.zip
does
not exist. This package was present in jdk1.0.2. If you try to compile
TclTest.java
with the jdk1.1 javac
, you will get
TclTest.java:13: Package sun.tools.zip not found in import. import sun.tools.zip.*;
tcljava0.4
tar file and then patch it with
patch < tcljava0.4a.patchwhile in the directory above tcljava0.4 directory.
configure
has a number of options to set the paths.
You can use: configure -help
to see them all.
--with-java
--with-java
option to tell configure where your Java installation is. If you java
installation is at /opt/jdk1.1
, then you would use
/usr/local
), then you may need to call configure
with other arguments.
I believe that to Install Tcljava under NT, you must rebuild Tcl from scratch. If you do not rebuild Tcl from scratch, then when you try to link with the tcl and tk dll, VC++ will complain about invalid objects.
I don't think that java native methods can be compiled under gcc, if you
run javah
, then the .c
file that is generated
has a line like:
__declspec(dllexport) stack_item *Java_tcl_Interp_native_0005feval_stub(stack_item *_P_,structexecenv *_EE_) {I downloaded the cygwin gcc (version cygnus-2.7.2-961023), and it failed to compile this line, the error message was:
tcl_classes.c: In function `__declspec': tcl_classes.c:8: syntax error before `{'I also had problems compiling
c:\jdk1.\include\win32\typdefs_md.h
, with gcc, there were
errors in the INT_OP
declaration. I also had problems
__int64
in typdefs_md.h
.
Perhaps gcc can be used here, but I did not look into this any further.
http://www.tcltk.com/itcl
c:\Itcl2.2
makefile.vc
files. The itcl2.2a.tar.gz
gzipped
tar file contains the appropriate fixes. You should grab itcl2.2a.tar.gz
and untar it over the Itcl2.2 distribution. itcl2.2a.tar.gz
contains the following fixes:
tk4.2/win/makefile.vc
needed the
$(IWISH)
rule changed to $(WISH)
.
makefile.vc
needed:
TKLIBDIR = $(TKDIR)\Win
itk/win/makefile.vc
needed
TARGET_DOC_ITK = $(TARGET_DOC)\Itk
make
install
will not fail if it is run a second time because mkdir
fails.
cd c:\Itcl2.2 nmake -f makefile.vc dist nmake -f makefile.vc installNote that if you have already previously installed Tcl/Tk, you should remove any preexisting Tcl/Tk libraries, such as
tcl76.dll
or tcl76i.dll
nmake
,
all the files are rebuilt, then try using the Cygnus chmod
and touch
commands to update the mod times on all the files.
The problem I noticed was that many of the files are dated Dec 31, 1969.
http://www.javasoft.com
.
I installed it in c:\jdk1.1
tcljava0.4a
(gzipped tar
file). This file is based on tcljava0.4
, but it has been
patched for use with jdk1.1, configure and NT. I installed this as
c:\tcljava0.4a
tcljava0.4
:
tkJava.c
was failing to compile with
lots of problems in rpcdce.h
. The following small
test program fails to compile:
#includeThe rule I used to test this was:#include int foo() { return 1;}
tkj.obj: cl -Ic:\jdk1.1\include -Ic:\jdk1.1\include\win32 \ -I$(TOOLS32)\include $(TK_INCLUDES) \ /c tst.cThe fix is to insert
/* NT4.0, vc++: If you don't undef Status, then rpcdce.h won't compile -cxh */ #ifdef _MSC_VER #undef Status #endifright before the line that includes
oobj.h
.
TclTest.java
JDK1.1 under Windows does not include the
sun.tools.zip
package, so I had to comment out
a number of lines that tried to use it before the
TclTest.java
class would compile
perror
not being defined, so I modified the makefile.vc to not
define EXECHACK
TclTest.java
When trying to run java TclTest
, I kept getting
errors about create
not being found. The fix was
to load the library at the top of main
instead of
in the TclTest
static
section.
cd c:\tcljava0.4a nmake -f makefile.vc all
TCL_LIBRARY
and TK_LIBRARY
environment
variables. Under NT, I brought up the control panel, selected the
System Icon and then the Environment Tab.
TK_LIBRARY
to
c:/Program Files/Itcl2.2/Lib/Itcl/Tk4.2
java TclTest