2

I`m trying to execute a perl script with parameters from my java code.

Process proc = Runtime.getRuntime().exec("perl C:\\Users\\MIKE\\Desktop\\EvaluateCase\\ROUGE-1.5.5.pl -e data  -f A -a -x -s -m -2 -4 -u C:\\Users\\MIKE\\Desktop\\EvaluateCase\\CaseFromMike\\setting.xml");

The process exec failed and exit with value:255

The command works when I run in command prompt. please help.

7
  • How do the perl script and your XML look like? Commented Mar 17, 2014 at 6:42
  • It depends on your script, but just in case try Process proc = Runtime.getRuntime().exec("perl", "C:\Users\MIKE\Desktop\EvaluateCase\ROUGE-1.5.5.pl", "-e", "data", "-f", "A", "-a", "-x", "-s", "-m", "-2", "-4", "-u", "C:\Users\MIKE\Desktop\EvaluateCase\CaseFromMike\setting.xml"); Commented Mar 17, 2014 at 6:43
  • Is your double quoted string being interpolated? Maybe if you just change your command to use single quotes? Process proc = Runtime.getRuntime().exec('perl C:\....blahblahblah'); Commented Mar 17, 2014 at 7:06
  • @Miller what are you talking about? This is Java code, and Java doesn't even have string interpolation. Strings are always delimited by double quotes, single quotes are used for character literals. Commented Mar 17, 2014 at 7:56
  • @Demnogonis you could find Rouge.pl from research.microsoft.com/~cyl/download/ROUGE-1.5.5.tgz Commented Mar 17, 2014 at 8:11

1 Answer 1

2

The option -e of the script is also a path, use C:\\Users\\MIKE\\Desktop\\EvaluateCase\\data instead of just data:

Process proc = Runtime.getRuntime().exec(
        "perl C:\\Users\\MIKE\\Desktop\\EvaluateCase\\ROUGE-1.5.5.pl " +
        "-e C:\\Users\\MIKE\\Desktop\\EvaluateCase\\data " +
        "-f A -a -x -s -m -2 -4 " +
        "-u C:\\Users\\MIKE\\Desktop\\EvaluateCase\\CaseFromMike\\setting.xml");
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.