tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wade Chandler <hwadechandler-apa...@yahoo.com>
Subject Re: How can I modify the java.library.path in Tomcat?
Date Sat, 03 Jun 2006 02:41:13 GMT
--- Andi Heusser <aheusser@gmail.com> wrote:

> 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

I like finer control over loading native files.  I use
System.load instead.  You can get your web app path
from the Servlet API.  It makes it easier and you
don't have to make sure your library is on a path.

Wade

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message