I'm no expert but I'll try to help.

The big question is how are you running your application, is there a
specific maven goal/plugin you can speak of? If this is in the same JVM as
maven then you'll need to kick maven off with an extra command line
argument. If maven fork's the execution off to a system exec process then
it'll be on a different jvm.

But, this is really a JVM issue and not maven. Classloaders are irrelevant,
you will get only one java.library.path per jvm that shouldn't be modified
at runtime (but it can be hacked).

If you want this to work inside and out outside eclipse, then you might be
able to set -Djava.library.path in the MAVEN_OPTS environment param. There's
probably a few ways todo this too.

If you only want this to work in eclipse, then I think there are parameters
and jvm arguments that you can add to the run configuration. Specifically,
set -Djava.library.path

Another idea, that I don't like but can be used as a fallback is...If you
can work out at runtime the absolute path of dll/so then you can do
System.load(); instead of System.loadLibrary(). But that's not always an
option.

Sorry I can't offer you a perfect howto.


On Sun, Apr 18, 2010 at 10:08 PM, Jon Kristensen <[email protected]>wrote:

> Hello people!
>
> I need some kind of native library support in m2eclipse.
>
> Maven is compiling and packaging my project nicely but in order to let
> m2eclipse handle the dependency management and run my application from
> within Eclipse I need the so/dll etc files to be put on the classpath
> and possibly also java.library.path to be set.
>
> Does maven deal with native library files in any special way? Also, do
> you have any suggestions on how this feature should work?
>
> Thank you in advance!
>
> Warm regards,
>
> --
> Jon Kristensen <[email protected]>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to