...

View Full Version : How to call Java class methods from Perl?



sdsdsd
01-20-2010, 11:55 PM
Hi,
I need to call a Java class method from within Perl code. The Inline method is not a good choice for me since the Java method is big and it's populating a few database tables. How can I do this? Thanks.

FishMonger
01-21-2010, 01:58 AM
I don't work with Java, but a quick cpan search came up with this:

Java::Import - Use Java classes in Perl
http://search.cpan.org/~rusekd/Java-Import-0.03/lib/Java/Import.pm

Java::Import::Examples - Example of how to use Java::Import to call into Java classes
http://search.cpan.org/~rusekd/Java-Import-0.03/lib/Java/Examples.pod

http://search.cpan.org/search?query=java&mode=all

sdsdsd
01-22-2010, 06:42 PM
Thank you for the links. They are certainly helpful. I just have one other question and that is if the Java code is on the same machine as the Perl code, what do I need to set (environment variables, path, ...) on that machine? Thanks.

FishMonger
01-22-2010, 07:04 PM
Since I don't work with Java, I can't say what env vars and paths it needs. You may need to ask that in the Java forum.

Within Perl, you set environment vars via Perl's %ENV hash.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum