One Star

tSetEnv : my environment variable is null

Hello,
I want to use the tSetEnv component to add environment variable values to my system but I get null values.
In the tSetEnv, I define a variable called test with the value "C:/test"
I test the integration of this variable with a tJava component connected to the tSetEnv component by onComponentOk.
The Java code is:
System.out.println((System.getenv("test"));

I get a null value..
Any help would be greatly appreciated!
Thanks!
6 REPLIES
Employee

Re: tSetEnv : my environment variable is null

Hi,
try with this :
System.out.println(System.getProperty("test"));

bye
One Star

Re: tSetEnv : my environment variable is null

Thanks for the answer. It returns me the value but this one seems not to be integrated in my process..
I'm under Windows and trying to industrialize the use of the execution af an OCR process through tesseract.
Here is my test job:
tSetEnv---->tSystem

I put an environment variable named TESSDATA_PREFIX with the value "C:/tesseract-2.04/"
It's the path of the tesseract folder
Then, in the tSystem, I put:
"tesseract C:/tests/OCR/test.tif C:/testOCR -l fra"

But i get the following message:
Unable to load unicharset file ./tessdata/fra.unicharset

It means that it didn't take into account the TESSDATA_PREFIX env variable.
It it had been the case, it would have searched the file into /tessdata/fra.unicharset
Does tSetEnv integrate environment variables in the machine system or is it internal to the software?
Any idea?
One Star

Re: tSetEnv : my environment variable is null

any idea for this problem?
One Star

Re: tSetEnv : my environment variable is null

Faced same problem.
One Star

Re: tSetEnv : my environment variable is null

me too....
Moderator

Re: tSetEnv : my environment variable is null

Hi FabriceS,
Would you mind uploading your component tSetEnv setting screenshot into forum? More information will be helpful for us to address your issue.

Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.