Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Java Perl
Hi,
 
I have a small Java code which I exported to a .jar file.
 
The .jar file has some methods, one of which is a simple method (that displays a message box). Now, I want to write a perl script that can call this method.
 
How do I go about this? How do I import the jar file in a Perl script? After importing the jar file, how do I call the method?
Posted 9-Jan-11 20:23pm
Edited 9-Jan-11 21:30pm
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

One solution is to call your java method from c using jni, and then create a perl wrapper for the c function.
 
swig[^] may help you getting this done faster.
 
Update:
You can use Jace[^] to create a c++ wrapper for your java project. Then use swig to create a perl wrapper for the c++ code.
 
You can always try:
Call Java from Perl
[^] - it will probably work, but I haven't tried it myself.
 
Regards
Espen Harlinn
  Permalink  
v2
Comments
S.Raaj Nishanth at 10-Jan-11 4:05am
   
Is there a way to directly call the java method from perl. I'm not very confident about writing a C-program to do this.
S.Raaj Nishanth at 11-Jan-11 23:22pm
   
Thank you. I think "Call Java from Perl" should do the trick.
Espen Harlinn at 12-Jan-11 4:35am
   
Nice that I was able to help. Voting and marking the question as answered will be appreciated :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web02 | 2.8.140709.1 | Last Updated 10 Jan 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid