Reputation: 1791
I wanted to run this zipTransfer.pl
perl program from within a function in Java
private void runZipTransfer() throws IOException {
Runtime.getRuntime().exec(new String[] {"C:\\Perl64\\bin", "C:\\Lazy\\zipTransfer.pl"});
}
When running my Java program, however, nothing happens! Where's the issue here?
Upvotes: 0
Views: 106
Reputation: 14709
Try:
Runtime.getRuntime().exec(new String[] {"perl", "C:\\Lazy\\zipTransfer.pl"});
Upvotes: 0
Reputation: 6798
You need to execute the perl interpreter:
Runtime.getRuntime().exec(new String[] {"C:\\Perl64\\bin\\perl.exe", "C:\\Lazy\\zipTransfer.pl"});
Upvotes: 1