Thanks for your quick response.
Unfortunately(?), the ability to call Perl directly from Java is exactly what I need. We've got a Perl system for dealing with a database that we've been developing over the last two years. Now, another project wants to use our system, but they've developed everything in Java. If I can provide them with a wrapper Java class that encapsulates our Perl system, we provide them the functionality they need and I save myself a whole lot of work.
I got the thing running on my Windows machine, and managed to make an instance of the main Perl object that is the entry point to our system and start calling functions on it. The problem is that we are married to Postgres, and the windows port for that is still experimental as well (we're just bleeding edge all over the place).
At any rate: find /usr/local/perl_java -name libperl.so turned up nothing.
Armed with your input, and despite the late hour, I have gone off and created a dynamically built Perl. Success! The tests all succeed, and I am able to install the module.
Yes, a test for a dynamically built perl would be helpful, as it would save poor sods like me some Google hours.
Now, I have attempted to run my Java program (which works on the Windows box) and get a similar error when I make a PerlInterpreter. The Java code:
System.out.print("Creating Perl interpreter...");
pi = InlineJavaPerlInterpreter.create();
System.out.println("OK");
compiles fine, but results in:
Creating Perl interpreter...java: error while loading shared libraries: /usr/local/perl/lib/auto/Cwd/Cwd.so: undefined symbol: Perl_Gthr_key_ptr
(the error is caught elsewhere, which is why you see "java: " prepended to the error message).
As the new perl is a special build for playing around with your module, and therefore is not the Perl that /usr/bin/perl points to, I am assuming that this error is because we are calling the wrong Perl. Any way of indicating that we want to use a different Perl? I've checked Inline::Java::Callback docs and see nothing that looks appropriate.
Thanks a million for your help.
Patrick LeBoutillier wrote:
Aaron,
The PerlInterpreter stuff is still experimental so unless your goal is really to call Perl from directly Java, you
don't need to worry about it.
Here's what I think is the problem:
libc=/lib/libc-2.2.4.so, so=so, useshrplib=false, libperl=libperl.a
I think your Perl is statically built (libperl=libperl.a), so that's why the PerlInterpreter module can't
load the perl library dynamically. Please tell me that is the case (see if you can find libperl.so in the Perl directories) and if so I will try to put in a test case for that.
In any event, just say 'no' to building PerlInterpreter when you install and you will be ok to use Inline::Java
for the rest of the stuff.
Patrick
-- Aaron Craig [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
-=-=-
How far that little candle throws his beams! So shines a good deed in a naughty world!
-=-=-