On Tue, 2 May 2006, Stephen Duncan wrote: > Sorry, forgot to mention that I tried with forkMode set to once & with > it set to pertest. Still didn't work. > > Could it be that <systemProperties> aren't passed to the JVM when it's > forked? They are only set afterwards?
Took me some digging, but the system properties are loaded after the jvm is started. The only way to define them in time is to define command line arguments to the jvm: <argLine>-Djava.library.path=....</argLine> AND use forkMode once or pertest. You could also configure environment vars like LD_LIBRARY_PATH but that's not really portable. Hope this helps, -- Kenney > > -Stephen > > On 5/2/06, Kenney Westerhof <[EMAIL PROTECTED]> wrote: > > On Tue, 2 May 2006, Stephen Duncan wrote: > > > > Hi, > > > > The library path is only scanned on JVM startup; you can't modify it later > > and expect the JRE to load any additional libraries. > > > > You'll have to use forked tests for that to work. Try configuring the > > surefire plugin to have <forkMode>once</forkMode>, for instance. > > > > -- Kenney > > > > > > > I have a colleague with a problem running a JUnit test. It works in > > > Eclipse, but not with Maven. > > > > > > Basically, he uses a class that needs to load a native library. The > > > location of a directory to look for this native .so object is > > > specified with java.library.path. > > > > > > Initially, this value was not being set correctly because you must > > > specify it using <systemProperties>, not <argLine>. We fixed that, > > > and now a debug output indicates that > > > System.getProperty("java.library.path") does return correctly. > > > However, the error indicating that the native library could not be > > > found persists. Any ideas on where else to look or tips on > > > troubleshooting? > > > > > > -- > > > Stephen Duncan Jr > > > www.stephenduncanjr.com > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > -- > > Kenney Westerhof > > http://www.neonics.com > > GPG public key: http://www.gods.nl/~forge/kenneyw.key > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > -- > Stephen Duncan Jr > www.stephenduncanjr.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Kenney Westerhof http://www.neonics.com GPG public key: http://www.gods.nl/~forge/kenneyw.key --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]