Apache Commons Exec is a Java library that makes it easier to launch external processes from a Java application.
Questions tagged [apache-commons-exec]
87 questions
0
votes
1 answer
Apache Commons Exec: executable not in PATH
How do I execute a program which is NOT on the system PATH (and I don't want to put it there)? Eg. the simplest example:
String program = "/my/path/to/my/program";
new…

egbokul
- 3,944
- 7
- 36
- 54
0
votes
1 answer
Commons exec: Launch, send to child process, and read back on stdin/stdout
How can I achieve the following in Apache Commons Exec? (There doesn't seem to be any documentation for this use case).
Launch a child process.
Pass the child process a string on its stdin.
Wait for the child process to terminate.
Collect the…

user3364825
- 1,541
- 1
- 15
- 23
0
votes
1 answer
Launch another program from webserver on one request and kill it on a later request
I have a Java webserver from which I'm launching an external application using Apache commons exec. On a high level, the flow is that the user will specify parameters and start the application with a POST, and will then have a status page from which…

Michelle
- 2,830
- 26
- 33
0
votes
1 answer
Commons exec looking for main class in environment variable value
I'm trying to launch a script from within a Java application using Apache commons exec, and getting the following error:
Error: Could not find or load main class "-DappEnv=te
org.apache.commons.exec.ExecuteException: Process exited with an error: 1…

Michelle
- 2,830
- 26
- 33
0
votes
1 answer
Thread-safe way to call an external process (and grab its output stream) from inside an EJB
How do I call an external process in a thread safe way from inside an EJB?
ProcessBuilder is not thread safe, as stated in the javadoc. Apache commons exec says nothing about thread-safety and I am not confident in Runtime.exec either.
What's the…

Leo
- 6,480
- 4
- 37
- 52
0
votes
1 answer
How to run selenium standalone server as hub using apache commons exec?
I am trying to start selenium-standalone-server as a hub in java program. I have tried to use ProcessBuilder and Process. I was unable to do so. Then I found Apache Commons exec library. I am able to launch selenium server. But, when I am using…

M1017108
- 397
- 5
- 14
0
votes
1 answer
Apache CommonsExec async call preventing sync call
I have two calls that I perform using CommonsExec - one is a standard synchronous call in which I call a batch file to compile a maven project, and the next is a asynchronous call also to a batch file that runs the compiled command line project.
The…

Evan Knowles
- 7,426
- 2
- 37
- 71
0
votes
2 answers
"adb start-server", Java, Gradle and apache-commons-exec: how to make it right?
I am running into various problems when trying to run android start-server from within Java as external process. The Java is called by Gradle. Let me describe to you what is exactly happening in various scenarios:
Environment
Windows 7 X64
Java…

Konrad Jamrozik
- 3,254
- 5
- 29
- 59
0
votes
0 answers
Can commons-exec executor spawn sub-threads?
I have an ant build which compiles C++ using VS cl.exe, groovy and java. I'm building a program to automate switching branches and I've found commons-exec.
The problem I have is that some of the subants spawn multiple threads to speed up the build…

LiamRyan
- 1,892
- 4
- 32
- 61
0
votes
2 answers
How to run a java program using apache commons-exec?
I am trying to run java code dynamically in my java application GUI. I have tried the following code:
Sring tempfile="java -classpath "+wrkdir+"/bin "+runfile;
CommandLine cmdLine = CommandLine.parse(tempfile);
…

Salini
- 11
- 1
- 2
- 8
0
votes
2 answers
Trouble using Apache Commons exec
Im trying to use Apache commons to run a script and the script from run from a terminal looks outputs data similar to the following --
EDIT --Edited to introduce waitFor as suggested.
$./old-regress.sh
End with '*' as postcode !
…

ping
- 1,229
- 3
- 21
- 41
0
votes
1 answer
Different output -- when running mathtext in command line and when the command is executed from a java program using apache-commons-exec
I am trying to run mathtext from a java program using apache-commons-exec. The problem is I am getting different output when I run the same command from a java program and when I run it through shell.
so if run mathtext like this in the…

Shankhoneer Chakrovarty
- 690
- 1
- 6
- 19