Our tests have always been forked and I do want to avoid hacks, which is why
I am coming to this forum.

Cool.

   <!-- we now reset java.library.path to something specific to this project -->
   <sysproperty key="java.library.path" path="${junit.lib.path}"/>

This is enough for the libraries directly loaded by System.loadLibrary,
but not for their dependencies.

   <!--
        However, it doesn't seem to work under Linux.  Native libraries
needed
        by Java are loaded correctly but other native libraries needed by
        native libraries loaded by Java cannot be found

        None of the following worked (aside from not being platform
independent)

   <sysproperty key="LD_LIBRARY_PATH" path="${junit.lib.path}"/>

Needs to be an <env>.

   <env key="LD_LIBRARY_PATH" path="${junit.lib.path}" />
   <env key="LD_LIBRARY_PATH" path="${env.LD_LIBRARY_PATH}${path.separator
}${lib.package}" />
   <env key="LD_LIBRARY_PATH" path="${env.LD_LIBRARY_PATH}${path.separator
}${lib.package}" />

I don't see why this wouldn't work. On some platform you need a 32 or
64 suffix, or SHLIB something instead of LD_LIBRARY_PATH. Dynamic
loading is very platform-specific.

   the following also works on Windows if you also remove the sysproperty
above, however this
   is not platform independent and should be avoided
   <env key="PATH" path="${junit.lib.path}" />
   -->

PATH or Path has to be used on Windows. That's the equivalent of LD_...

I had a custom task that would give me the name and the value of the
binary and library paths in a platform independent manner, i.e. the
task looked at the current OS, and lookup which var to use. Supporting
a new platform required updating the task. Basically it was a switch.
--DD

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to