简体   繁体   中英

Setting environment variable TESSDATA_PREFIX in Tomcat

We are using Tesseract OCR Java library called Tess4J. It works fine if run as a standalone application. It needs a variable called TESSDATA_PREFIX which contains the tessdata config and other charset related files.

It also runs fine with embedded Tomcat 6 server in eclipse. I had set TESSDATA_PREFIX as an environment variable by using the launch configuration.

But when I package everything into a WAR and drop it in deploy directory of tomcat, the environment variable does not seem to be picked and the server crashes the moment it encounters the doOCR api( which needs the tessdata config).

I tried setting this env variable inside catalina.bat and also thru command line, but no luck.

Tomcat中的环境变量应放在bin目录中的setenv.bat / setenv.sh脚本中。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM