Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

can't execute perl script from java

807603May 24 2005 — edited Nov 15 2007
I have a Perl script located in a directory on my hard drive that I want to execute from within a Java servlet. The directory it is located in is "C:\Documents and Settings\brubaker\jbproject\PILOT\PILOT\files\uploads\testcase". The filename is "cml2.pl". I currently have this code that is trying to run this script and it's not working(and not giving me any error messages either). The script works fine when run manually from the command prompt of DOS.

String executionString = "cd \"" + pilotConstants.filepath + "\\uploads" + (zippy.getName()).substring(zippy.getName().lastIndexOf("\\"), zippy.getName().lastIndexOf(".")) + "\"";

Process p = Runtime.getRuntime().exec(executionString);

executionString = "perl cml2.pl";

p = Runtime.getRuntime().exec(executionString);

Any help would be greatly appreciated!

Thanks!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 13 2007
Added on May 24 2005
8 comments
354 views