• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Calling Perl Script in Java.

 
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?
 
Marshal
Posts: 67343
256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not a beginner's question. Moving.
 
author
Posts: 3281
8
Mac OS X Eclipse IDE Java
  • 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.
 
Rancher
Posts: 43011
76
  • 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
 
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
Posts: 3281
8
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Opens pg 763.... Ah it says "use the Inline:Java" module for PERL
 
WARNING! Do not activate jet boots indoors or you will see a tiny ad:
Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps
https://coderanch.com/t/722574/Sauce-Labs-World-Largest-Continuous
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!