[tcljava-user] Help accessing environment variables from Java and Jacl
Brought to you by:
mdejong
From: Omar E. J. V. <oma...@gm...> - 2011-03-06 13:15:49
|
Hello everybody, I'm working on a proyect made in Java that needs to execute tcl scripts. This project is running on Linux. So far I used tjc to compile simple tcl scripts and turn them into Java classes. Then, from Java I executed the simple proc successfully. Now that I'm adding more functionalities to the project, I add them to the tcl script then I recompile and use those compiled classes in Java again. But I'm running into troubles here because the added functionalities include sourcing a tcl script which access global variables like PATH. The problem is: when I initialize the class, and the sourced script tries to access PATH environment variable I get the following error: tcl.lang.TclVarException ==> in Java can't read "env(PATH)": no such element in array ==> result from command execution I verified that 'global env' is included in the proc that uses PATH and I executed the script in command line and works correctly. However when I compile the script with tjc and run it with Java I get this error. Please if you can give me some pointers to look at to fix this problem, I''ll be happy to tried them :D Thanks for your time, I really appreciate it Omar Jimenez |