Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Java System commands

Status
Not open for further replies.

mikedaruke

Technical User
Mar 14, 2005
199
US
I have a little mini application I am running.

When I click on an option can have it run a system command?

I want it to run a perl script.

So some how it has to go to the directory where the perl script is execute the perl script

Thanks in advance.
 
I'm not used to perl, but let's assume you call a perl script that way:
Code:
/usr/bin/perl /path/to/perlscript.pl
than you would call it from java like this:
Code:
String cmd ="/usr/bin/perl /path/to/perlscript.pl";
Runtime.getRuntime ().exec (cmd);

Most problems working with Runtime.exec are explained here:


seeking a job as java-programmer in Berlin:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top