Hi,

 

I have a web application where I need to load some 3rd party libraries DLLs)
and I would like to have these DLLs in a subdirectory in my app
(webapps/MyApp/WEB-INF/lib). However when I try to do a 'loadLibrary' it
fails to find them. I then noticed that the 'Tomcat/bin' directory is in
this path and if I copy the DLLs in there, then it works fine.

 

I've tried to set the system property inside my app in the static
initializer of the main class but that doesn't seem to work. I basically
tried to do the following:

      static{

            String libPath = System.getProperty("java.library.path");

            String myLibPath = System.getProperty("myapp.lib.path");
//env var set in PC's system variables (WinXP)

            System.setProperty("java.library.path", libPath +
File.pathSeparator + myLibPath);

      }

 

I also looked through the Tomcat conf files but I couldn't find any place
where I could properly set or override the java.library.path.

 

Is there a way to set this in Tomcat or will I have to copy the DLLs into
Tomcat's bin directory?

 

Thanks.

Regards,

Andi

 

Reply via email to