[tcljava-user] problems embedding GroupKit (tcl program) !!
Brought to you by:
mdejong
From: <ja...@ho...> - 2004-11-30 17:21:25
|
<html><div style='background-color:'><DIV class=RTE> <P>Hello,</P> <P>I'm trying to embed a tcl application (its name is GroupKit) into java, this application consists basicly in the manage of the synchronization among several clients, so it has a centralized architecture: one server, several clients. I've downloaded the tcljava.jar and jacl.jar, and I've added them to my classpath.</P> <P>Groupkit has to tcl methods to throw: registrar.tcl (server) and openreg.tcl (clients); for now I'm just trying to make work the server (that's the first step).</P> <P>The file registrar.tcl is as follows:</P> <P># registar.tcl --<BR>#<BR># This Windows shell script is used to invoke the registrar.<BR>#<BR># Copyright (c) 1997-1998 The University of Calgary.<BR>#<BR># See the file "license.terms" for information on usage and<BR># redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.<BR>#<BR># CVS: $Id: registrar.tcl,v 1.1.1.1 2003/02/12 14:47:41 cthatcher Exp $</P> <P>package require gk<BR>wm withdraw .<BR>gk::registrar<BR>vwait blah<BR></P> <P>so I've tried to throw this registrar.tcl using "interp.evalFile" in java like this:</P> <P>import tcl.lang.*;</P> <P>public class Pru<BR>{<BR> <BR> public static void main(String args[])<BR> {<BR> Interp interp= new Interp();<BR> <BR> String scriptFileName1="H:\\Tcl\\bin\\registrar.tcl";<BR> String scriptFileName2="H:\\Tcl\\bin\\openreg.tcl"; <BR> <BR> try<BR> {<BR> //interp.pkgRequire("gk",null, false);<BR> interp.evalFile(scriptFileName1);<BR> <BR> //interp.evalFile(scriptFileName2);<BR> } catch (Exception ex)<BR> {<BR> ex.printStackTrace();<BR> }<BR> }<BR>}</P> <P> </P> <P>the message error is:</P> <P>tcl.lang.TclException: can't find package gk<BR> at tcl.lang.PackageCmd.pkgRequire(PackageCmd.java)<BR> at tcl.lang.PackageCmd.cmdProc(PackageCmd.java)<BR> at tcl.lang.Parser.evalObjv(Parser.java)<BR> at tcl.lang.Parser.eval2(Parser.java)<BR> at tcl.lang.Interp.eval(Interp.java)<BR> at tcl.lang.Interp.evalFile(Interp.java)<BR> at Pru.main(Pru.java:16)</P> <P> </P> <P>so I don't know what can I do to tell java how to find the right direcotry to find the package, because I think that the package which he needs (groupkit package --> gk) is in H:\Tcl\lib\gk5.2, and I've tried to use the command: interp.pkgRequire(); but I don't know how to let him to know the right path.</P> <P>Any IDEA???</P> <P>Thank you very very much !!</P></DIV></div><br clear=all><hr>Encuentra una aventura, un romance o al amor de tu vida. <a href="http://g.msn.com/8HMAESES/2737??PS=47575" target="_top">Date de alta gratis.</a> </html> |