Thread: [tcljava-user] Executing tcl script from java using Interp, need help about classpath
Brought to you by:
mdejong
From: Ying J. <yi...@as...> - 2001-03-29 06:13:25
|
Hello, I tried to run code: Interp interp; interp = new Interp(); interp.eval("puts {Hello, world}"); interp.dispose(); -------------------------------------------- I got error: Exception in thread "main" java.lang.NullPointerException at tcl.lang.Interp.create(Native Method) at tcl.lang.Interp.<init>(Interp.java:130) at RuleMgr.main(RuleMgr.java:11) tcl.lang.TclRuntimeError: could not find class java/lang/Object. Check that your path includes the directory where tclblend.dll resides. Try looking in the directories under the value of tcl_library.. ----------------------------------------------------------- But I already set path and classpath to the lib of tcl and tclblend: set path=%path%;f:\jdk1.2.2\bin;C:\Progra~1\Tcl\lib;c:\Progrm~1\Tcl\lib\tclblend;c:\unzipped\tclblend126\tclblend1.2.6\win set classpath = %classpath%;f:\jdk1.2.2\lib;c:\unzipped\tcl823\tcl8.2.3\win;c:\unzipped\tclBlend126\tclBlend1.2.6\win\tclblend\;c:\unzipped\tclBlend126\tclBlend1.2.6\win\tcljava\;.;c:\Progra~1\tcl\lib\tclblend;C:\Progra~1\Tcl\lib --------------------------------------------------- What should be added to the path and classpath? Thanks a lot. |
From: Mo D. <md...@cy...> - 2001-03-29 06:17:12
|
On Wed, 28 Mar 2001, Ying Jin wrote: > Hello, > I tried to run code: > Interp interp; > interp = new Interp(); > interp.eval("puts {Hello, world}"); > interp.dispose(); > -------------------------------------------- > I got error: > Exception in thread "main" java.lang.NullPointerException > at tcl.lang.Interp.create(Native Method) > at tcl.lang.Interp.<init>(Interp.java:130) > at RuleMgr.main(RuleMgr.java:11) > tcl.lang.TclRuntimeError: could not find class java/lang/Object. > Check that your path includes the directory where tclblend.dll resides. > Try looking in the directories under the value of tcl_library.. > ----------------------------------------------------------- > But I already set path and classpath to the lib of tcl and tclblend: > set > path=%path%;f:\jdk1.2.2\bin;C:\Progra~1\Tcl\lib;c:\Progrm~1\Tcl\lib\tclblend;c:\unzipped\tclblend126\tclblend1.2.6\win > > set classpath = > %classpath%;f:\jdk1.2.2\lib;c:\unzipped\tcl823\tcl8.2.3\win;c:\unzipped\tclBlend126\tclBlend1.2.6\win\tclblend\;c:\unzipped\tclBlend126\tclBlend1.2.6\win\tcljava\;.;c:\Progra~1\tcl\lib\tclblend;C:\Progra~1\Tcl\lib > > --------------------------------------------------- > What should be added to the path and classpath? > Thanks a lot. You need to add tclblend.jar and tcljava.jar to the CLASSPATH. You can't just include the directory: set CLASSPATH=D:\tcljava.jar;D:\tclblend.jar Mo DeJong Red Hat Inc |
From: Ying J. <yi...@as...> - 2001-03-29 06:40:14
|
Thank you very much! I added tcljava.jar and tclblend.jar to my CLASSPATH, but I got the SAME error message. Could you give me further advise? Thanks a lot. I got the SAME error message when I ran this java code inside tcl (After I type nmake shell). But I can successfully run other commands like "puts "say hello" " inside tcl. I also can create my own extension command. The only problem is how to invoke tcl script by java code. My code stop at new Interp(). Inside the constructor of Interp.java, the code stop at "interpPtr=create( ) ;". Thanks a lot. Ying Mo DeJong wrote: > On Wed, 28 Mar 2001, Ying Jin wrote: > > > Hello, > > I tried to run code: > > Interp interp; > > interp = new Interp(); > > interp.eval("puts {Hello, world}"); > > interp.dispose(); > > -------------------------------------------- > > I got error: > > Exception in thread "main" java.lang.NullPointerException > > at tcl.lang.Interp.create(Native Method) > > at tcl.lang.Interp.<init>(Interp.java:130) > > at RuleMgr.main(RuleMgr.java:11) > > tcl.lang.TclRuntimeError: could not find class java/lang/Object. > > Check that your path includes the directory where tclblend.dll resides. > > Try looking in the directories under the value of tcl_library.. > > ----------------------------------------------------------- > > But I already set path and classpath to the lib of tcl and tclblend: > > set > > path=%path%;f:\jdk1.2.2\bin;C:\Progra~1\Tcl\lib;c:\Progrm~1\Tcl\lib\tclblend;c:\unzipped\tclblend126\tclblend1.2.6\win > > > > set classpath = > > %classpath%;f:\jdk1.2.2\lib;c:\unzipped\tcl823\tcl8.2.3\win;c:\unzipped\tclBlend126\tclBlend1.2.6\win\tclblend\;c:\unzipped\tclBlend126\tclBlend1.2.6\win\tcljava\;.;c:\Progra~1\tcl\lib\tclblend;C:\Progra~1\Tcl\lib > > > > --------------------------------------------------- > > What should be added to the path and classpath? > > Thanks a lot. > > You need to add tclblend.jar and tcljava.jar to the CLASSPATH. > You can't just include the directory: > > set CLASSPATH=D:\tcljava.jar;D:\tclblend.jar > > Mo DeJong > Red Hat Inc > > _______________________________________________ > tcljava-user mailing list > tcl...@li... > http://lists.sourceforge.net/lists/listinfo/tcljava-user |
From: Mo D. <md...@cy...> - 2001-03-29 06:49:52
|
On Wed, 28 Mar 2001, Ying Jin wrote: > Thank you very much! > I added tcljava.jar and tclblend.jar to my CLASSPATH, but I got the SAME error message. Could you give me further advise? Thanks a lot. > I got the SAME error message when I ran this java code inside tcl (After I type nmake shell). But I can successfully run other commands like "puts "say hello" " inside tcl. I also can create my own extension command. > The only problem is how to invoke tcl script by java code. > My code stop at new Interp(). Inside the constructor of Interp.java, the code stop at "interpPtr=create( ) ;". > Thanks a lot. > Ying Step 1: Run `nmake shell` that type `package require java`, that should work and return the version. Step 2: Get your CLASSPATH and PATH setup the same as in a `name shell` run. If that works you should be able to start tcl and run `package require java` without getting an error. If you get an error, then your path are not set correctly. That is all that is supported in version 1.2. Your "invoke tcl script by java code" comment is what has me wondering. Are you trying to load Tcl and Tcl Blend into an existing JVM? That is not supported in 1.2, but it does work in the 1.3 version in the CVS. Is that what you are trying to do? Mo DeJong Red Hat Inc |
From: Ying J. <yi...@as...> - 2001-03-30 21:02:27
|
Thank you for your response! There is a snippet of code from the documentation that we are trying to get to work. We are trying to create a tcl interpreter object from a Java program. The link to the documentation file in our installed copy of tclBlend is: C:\unzipped\tclBlend126\tclBlend1.2.6\docs\TclJavaLib\Interp.htm The snippet of code from that documentation says: EXAMPLE The following is an example of how an instance of the Interp object may be used: Interp interp; interp = new Interp(); interp.eval("puts {Hello, world}"); interp.dispose(); We created a Java program that has these lines of code. The code does not work for us and the problem appears to be the line that creates the new Interp object. We want to be able to call Interp.eval( ) from the Java program, sending it either a filename with tcl script or a string with a tcl command. The eval method of the Interp object is documented in the following html file from the documentation: C:\unzipped\tclBlend126\tclBlend1.2.6\docs\TclJavaLib\Eval.htm I hope this clarifies what we are trying to do. At the moment, we are just trying to get the example from the documentation to work. Are you implying that creating and calling Interp from Java does not work? We are confused when you say "That is all that is supported in version 1.2." Do you mean Java 1.2 or TclBlend 1.2? What do you mean by 1.3 version in the CVS? Amy Sundermier & Ying Jin Mo DeJong wrote: > On Wed, 28 Mar 2001, Ying Jin wrote: > > > Thank you very much! > > I added tcljava.jar and tclblend.jar to my CLASSPATH, but I got the SAME error message. Could you give me further advise? Thanks a lot. > > I got the SAME error message when I ran this java code inside tcl (After I type nmake shell). But I can successfully run other commands like "puts "say hello" " inside tcl. I also can create my own extension command. > > The only problem is how to invoke tcl script by java code. > > My code stop at new Interp(). Inside the constructor of Interp.java, the code stop at "interpPtr=create( ) ;". > > Thanks a lot. > > Ying > > Step 1: > > Run `nmake shell` that type `package require java`, that should > work and return the version. > > Step 2: > > Get your CLASSPATH and PATH setup the same as in a > `name shell` run. If that works you should be able > to start tcl and run `package require java` without > getting an error. If you get an error, then > your path are not set correctly. > > That is all that is supported in version 1.2. > Your "invoke tcl script by java code" comment is what > has me wondering. Are you trying to load Tcl and > Tcl Blend into an existing JVM? That is > not supported in 1.2, but it does work > in the 1.3 version in the CVS. Is that > what you are trying to do? > > Mo DeJong > Red Hat Inc > > _______________________________________________ > tcljava-user mailing list > tcl...@li... > http://lists.sourceforge.net/lists/listinfo/tcljava-user |
From: Mo D. <md...@cy...> - 2001-04-01 01:36:13
|
On Fri, 30 Mar 2001, Ying Jin wrote: > We created a Java program that has these lines of code. The code does not work for us and the problem appears to be the line that creates the new Interp object. > > We want to be able to call Interp.eval( ) from the Java program, sending it either a filename with tcl script or a string with a tcl command. The eval method of the Interp object is documented in the following html file > from the documentation: > C:\unzipped\tclBlend126\tclBlend1.2.6\docs\TclJavaLib\Eval.htm > I hope this clarifies what we are trying to do. At the moment, we are just trying to get the example from the documentation to work. It sounds like you are trying to load Tcl Blend into a JVM process. That is not supported in the 1.2 release of Tcl Blend. > Are you implying that creating and calling Interp from Java does not work? Yes. > We are confused when you say "That is all that is supported in version > 1.2." Do you mean Java 1.2 or TclBlend 1.2? What do you mean by 1.3 > version in the CVS? Tcl Blend 1.2. The 1.3 version in the CVS is a bit closer to working in this scenario but more testing and debugging is needed. Everything should work just fine if you start Tcl first and then load the JVM into a Tcl process. Mo |
From: W. J. G. <gu...@ea...> - 2001-04-01 04:25:43
|
I'm confused. We've been doing just this for months and it's been working fine. We have a Java process that loads and uses TclBlend and it's Interp and Notifier. Am I missing something? john > -----Original Message----- > From: tcl...@li... > [mailto:tcl...@li...]On Behalf Of Mo DeJong > Sent: Saturday, March 31, 2001 5:36 PM > To: tcl...@li... > Subject: Re: [tcljava-user] Executing tcl script from java using > Interp,need , ,help about classpath > > > On Fri, 30 Mar 2001, Ying Jin wrote: > > > We created a Java program that has these lines of code. The > code does not work for us and the problem appears to be the line > that creates the new Interp object. > > > > We want to be able to call Interp.eval( ) from the Java > program, sending it either a filename with tcl script or a string > with a tcl command. The eval method of the Interp object is > documented in the following html file > > from the documentation: > > C:\unzipped\tclBlend126\tclBlend1.2.6\docs\TclJavaLib\Eval.htm > > I hope this clarifies what we are trying to do. At the moment, > we are just trying to get the example from the documentation to work. > > It sounds like you are trying to load Tcl Blend into a JVM process. > That is not supported in the 1.2 release of Tcl Blend. > > > Are you implying that creating and calling Interp from Java > does not work? > > Yes. > > > We are confused when you say "That is all that is supported in version > > 1.2." Do you mean Java 1.2 or TclBlend 1.2? What do you mean by 1.3 > > version in the CVS? > > Tcl Blend 1.2. The 1.3 version in the CVS is a bit closer to working > in this scenario but more testing and debugging is needed. Everything > should work just fine if you start Tcl first and then load the > JVM into a Tcl process. > > Mo > > _______________________________________________ > tcljava-user mailing list > tcl...@li... > http://lists.sourceforge.net/lists/listinfo/tcljava-user |
From: Mo D. <md...@cy...> - 2001-04-01 04:33:00
|
On Sat, 31 Mar 2001, W. John Guineau wrote: > I'm confused. > > We've been doing just this for months and it's been working fine. We have a > Java process that loads and uses TclBlend and it's Interp and Notifier. > > Am I missing something? > > john You are using the 1.3 version from the CVS, right? Either that, or you must be using a patched version of 1.2.6. There was some major work done on the 1.3 tree to get this working correctly. 1.3 is not perfect yet, but at least it is designed to support this usage scenario. Mo DeJong Red Hat Inc |
From: W. J. G. <gu...@ea...> - 2001-04-01 16:20:19
|
Yes, we're using 1.3 right now, but have been using 1.2.6 all along. It did have some patches though, if I recall. john > -----Original Message----- > From: tcl...@li... > [mailto:tcl...@li...]On Behalf Of Mo DeJong > Sent: Saturday, March 31, 2001 8:32 PM > To: tcl...@li... > Subject: RE: [tcljava-user] Executing tcl script from java using > Interp,need , , ,help about classpath > > > On Sat, 31 Mar 2001, W. John Guineau wrote: > > > I'm confused. > > > > We've been doing just this for months and it's been working > fine. We have a > > Java process that loads and uses TclBlend and it's Interp and Notifier. > > > > Am I missing something? > > > > john > > You are using the 1.3 version from the CVS, right? Either that, or > you must be using a patched version of 1.2.6. There was some > major work done on the 1.3 tree to get this working correctly. > 1.3 is not perfect yet, but at least it is designed to support > this usage scenario. > > Mo DeJong > Red Hat Inc > > _______________________________________________ > tcljava-user mailing list > tcl...@li... > http://lists.sourceforge.net/lists/listinfo/tcljava-user |
From: D. J. H. <dha...@mi...> - 2001-03-29 06:47:53
|
In the absence of more info from the stack trace, my guess is that the Windows PATH needs to include the directories where the Java Runtime DLL's can be found. The .bat scripts included with tclblend may provide some information on the paths/dlls needed. -=- D. J. On Wed, 28 Mar 2001, Ying Jin wrote: > Hello, > I tried to run code: > Interp interp; > interp = new Interp(); > interp.eval("puts {Hello, world}"); > interp.dispose(); > -------------------------------------------- > I got error: > Exception in thread "main" java.lang.NullPointerException > at tcl.lang.Interp.create(Native Method) > at tcl.lang.Interp.<init>(Interp.java:130) > at RuleMgr.main(RuleMgr.java:11) > tcl.lang.TclRuntimeError: could not find class java/lang/Object. > Check that your path includes the directory where tclblend.dll resides. > Try looking in the directories under the value of tcl_library.. > ----------------------------------------------------------- > But I already set path and classpath to the lib of tcl and tclblend: > set > path=%path%;f:\jdk1.2.2\bin;C:\Progra~1\Tcl\lib;c:\Progrm~1\Tcl\lib\tclblend;c:\unzipped\tclblend126\tclblend1.2.6\win > > set classpath = > %classpath%;f:\jdk1.2.2\lib;c:\unzipped\tcl823\tcl8.2.3\win;c:\unzipped\tclBlend126\tclBlend1.2.6\win\tclblend\;c:\unzipped\tclBlend126\tclBlend1.2.6\win\tcljava\;.;c:\Progra~1\tcl\lib\tclblend;C:\Progra~1\Tcl\lib > > --------------------------------------------------- > What should be added to the path and classpath? > Thanks a lot. > > > > > _______________________________________________ > tcljava-user mailing list > tcl...@li... > http://lists.sourceforge.net/lists/listinfo/tcljava-user > |