setting LD_LIBRARY_PATH using tomcat's setenv.sh script
I can't seem to get tomcat to properly set environment variables. I can run my .jar normally with my LD_LIBRARY_PATH set to the correct place, it finds my external libraries just fine. If I unset LD_LIBRARY_PATH and run the jar I get the error:
java.lang.RuntimeException: Native code library failed to load:
ensure the appropriate library (opl<VERSION>.dll/.so) is in your path.
which is to be expected.
Anyway, I created 开发者_如何学Ca tomcat/bin/setenv.sh script that looks like this:
LD_LIBRARY_PATH=/home/public/lib
But when I run my code over the webservice I still get the same error:
java.lang.RuntimeException: Native code library failed to load:
ensure the appropriate library (opl<VERSION>.dll/.so) is in your path.
Any ideas?
export LD_LIBRARY_PATH
Is what you are missing.
and also perhaps an appropriate addition of -Djava.library.path=MYDIR
to the java flags.
精彩评论