Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JNI: Swing to PerL

 
Jesus Angeles
Ranch Hand
Posts: 2068
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My front end needs to be done using java swing/awt. I am however, required, to reuse existing perl codes. Is JNI able to talk to Perl directly? Or JNI to c, then c will talk to perl (if that is possible).
 
Timothy Wall
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jesus Angeles:
My front end needs to be done using java swing/awt. I am however, required, to reuse existing perl codes. Is JNI able to talk to Perl directly? Or JNI to c, then c will talk to perl (if that is possible).


JNA will allow you to call directly into a DLL which exports a C-callable interface, so you could conceivably call into the perl interpreter.

Alternatively you could invoke a perl process via Runtime.exec and collect the results via the filesystem.
 
Jesus Angeles
Ranch Hand
Posts: 2068
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the tip.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic