0

Able to call and execute the shell script when executed in an individual Java Program. But there is no output when called from a Floodlight controller program

The Floodlight controller is executed using java -jar target/floodlight.jar. The command to execute the shell script is provided in one of the source files. When ever the condition matches and code gets executed, the terminal screen appears for a second and vanishes. But this is not the case when I execute the same shell script with Java in an individual program.

Process proc = Runtime.getRuntime().exec(new String[]{"path to shell script", arg1});

Can anybody please comment on this ?

karra
  • 45
  • 1
  • 10
  • See [this question](https://stackoverflow.com/questions/525212/how-to-run-unix-shell-script-from-java-code) –  Dec 23 '18 at 07:44

1 Answers1

0

Executing with sudo or in root mode is the culprit. Ran in user mode, worked perfectly.

karra
  • 45
  • 1
  • 10