Setting environment variable TESSDATA_PREFIX in Tomcat

岁酱吖の 提交于 2020-01-12 10:40:17

问题


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.


回答1:


Environment variables in Tomcat should be put into a setenv.bat/setenv.sh script in the bin directory.



来源:https://stackoverflow.com/questions/6451661/setting-environment-variable-tessdata-prefix-in-tomcat

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!