Michael,
> But I've run into a little snag when trying to get this to work. It > seems to build the JNI extension just fine (all tests pass when running > under JNI too). And I get this message in during the build: > > You will also need to add the following directories > to your LD_LIBRARY_PATH environment variable: > /usr/java/jre/lib/i386/native_threads > /usr/java/jre/lib/i386 > /usr/java/jre/lib/i386/client > > So I do: > export \ > LD_LIBRARY_PATH=/usr/java/jre/lib/i386/native_threads:/usr/java/jre/lib/i386:/usr/java/jre/lib/i386/client > So when you set LD_LIBRARY_PATH like above you can get the test suite to run, but your app doesn't? Here's how I do it using a little trick: [EMAIL PROTECTED] Inline-Java]$ export `perl -Mblib -MInline::Java=so_dirs` [EMAIL PROTECTED] Inline-Java]$ export PERL_INLINE_JAVA_JNI=1 [EMAIL PROTECTED] Inline-Java]$ make test make[1]: Entering directory `/home/patrickl/DEV/Inline-Java/Java' make[2]: Entering directory `/home/patrickl/DEV/Inline-Java/Java/PerlNatives' make[2]: Leaving directory `/home/patrickl/DEV/Inline-Java/Java/PerlNatives' make[2]: Entering directory `/home/patrickl/DEV/Inline-Java/Java/PerlInterpreter' make[2]: Leaving directory `/home/patrickl/DEV/Inline-Java/Java/PerlInterpreter' make[1]: Leaving directory `/home/patrickl/DEV/Inline-Java/Java' PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/01_init.............. Perl version is 5.008005 Inline version is 0.44 Inline::Java version is 0.50_91 J2SDK version is 1.4.2_06, from /usr/java/j2sdk1.4.2_06/ CLASSPATH is <empty> Using JNI extension. t/01_init..............ok ... (Make sure it says "Using JNI extension.") If this is working and your app isn't it's probably an LD_LIBRARY_PATH thing. > > Then when I try to start my application I get this: > Error occurred during initialization of VM > Unable to load native library: libverify.so: cannot open shared object > file: No such file or directory > > Now I know that the file is there: > > ]# ls /usr/java/jre/lib/i386 | grep libverify > libverify.so > > I also tried setting this in my startup.pl > BEGIN { > $ENV{LD_LIBRARY_PATH} = > "/usr/java/jre/lib/i386/native_threads:/usr/java/jre/lib/i386:/usr/java/jre/lib/i386/client"; > warn $ENV{LD_LIBRARY_PATH}; > }; Even if the JNI libraries are loaded later, I don't think a process can change it's own LD_LIBRARY_PATH because the dynamic linker reads it only rigth when the process starts. You have to set it before in the shell (or in the parent process if you are getting forked off of it). > > And it does warn before the VM error, so it should be set right? > Am I missing something? > > -- > Michael Peters > Developer > Plus Three, LP > Patrick -- ===================== Patrick LeBoutillier Laval, Québec, Canada