ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven Morgan <>
Subject Re: Problem loading System Library
Date Fri, 09 Nov 2001 17:32:47 GMT
This was exactly my problem as well, so I wrote the attached task.  It allows you to
use <env> tags (like with <exec>) when invoking the JVM.

<taskdef classname="ant.extensions.JavaWithEnvTask" name="java-env">
  <classpath>(wherever you compile the task)</classpath>
<project ...>
  <target ...>
    <java-env src="..." dest="...">
       <env key="LD_LIBRARY_PATH" path="..."/>

Otherwise the task uses the same attributes and elements as <java>

Hope it helps!
-Steve  :)

> From: Sachin Pandey <>
> Subject: Problem loading System Library
>   Just wanted to know if it is possible to set the java.library.path in Ant 
> build Scripts. Even after setting the java.library.path as an jvmarg i get a 
> UnSatisfiedLinkError. The Library i am trying to load through Java , 
> internally loads other library and thats when it fails. These two libraries 
> are in two different directories. 
>    If i set the LD_LIBRARY_PATH Environment variable and include the two 
> directories things work fine . I want to do it through build script. And 
> since i am using the Java target, i can't specify the environment variable.
> <java classname="${client.class}"
>               fork="true">
> 	<jvmarg value="-Djava.library.path=${library1.path}:${library2.path}">
> </java>

(@) (@)  Steven Morgan

Do You Yahoo!?
Find a job, post your resume.
View raw message