I developed an GWT application which includes some native libraries with JNI. when I test it from eclipse everything works fine, but when I try to deploy it on my Eclipse server it can’t find the native libraries.
I followed this tutorial for JNI and Tomcat
but it still can’t find them I noticed. That when I read the java.library.path from within my serversided application it is different from what I get when I start Tomcat (displaying the path variables with set path).
Any ideas what I am missing?
The simplest answer might be to edit your Tomcat installation’s
bin/startupscript to change thejava.library.pathto wherever you’re copying the native library to. Something likeIf you’re using a shared hosting provider, you’ll need to consult with the owner to determine if they’ll allow native libraries to be loaded into the container, and if there’s a specific location to which the libraries should be copied.
Beyond that, there’s the meta problem of your development environment being different from your deployment environment. Ideally, you would have an exact copy (or as close as possible) of the deployment configuration running on your local development machine.