• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling Perl Script in Java.

 
chander shivdasani
Ranch Hand
Posts: 206
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have a couple of PERL scripts already written. I am developing an application using Swing. My requirement is that whenever some button is pressed i want to call a PERL script that will do its task.

Or the other way to put this would be that i m developing a GUI application which will call perl scripts in the background.Is this kind of thing possible?
 
Campbell Ritchie
Sheriff
Pie
Posts: 49865
71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not a beginner's question. Moving.
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you taken a look at the Runtime and Process classes? Oh and don't forget to Google "Why Runtime.exec() won't" for a classic article on the pitfalls to avoid when using these classes.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it certain that Perl will be installed on the machines where this application will run?

On Windows, another option would be to get hold of an old BSF version (2.3 or older); those versions support calling PerlScript code.
 
chander shivdasani
Ranch Hand
Posts: 206
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:Is it certain that Perl will be installed on the machines where this application will run?


Yes, PERL will be installed on the machines
 
John de Michele
Rancher
Posts: 600
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Chander,

If you have a copy of the Java Cookbook, 2E available, there is at least one recipe on using Perl scripts with Java..

John
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Opens pg 763.... Ah it says "use the Inline:Java" module for PERL
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic