Questions tagged [apache-commons-exec]

Apache Commons Exec is a Java library that makes it easier to launch external processes from a Java application.

87 questions
0
votes
0 answers

msi installer is not working with apache commons exec throws exit code 1639

I am trying to install a software with .msi file and it is working fine when I try in the Windows command prompt. But the same is not working in apache commons exec. When I run thru apache commons exec, it says exit code 1639 and the product is not…
0
votes
1 answer

Running Jekyll from Java program under eclipse on OSX

I have a java program that does some preparation and then invokes Jekyll on the content it's prepared. Jekyll is a Ruby program installed on the local PC as a gem. On windows and linux, no problem, but when running on OSX, under the eclipse…
Grahame Grieve
  • 3,538
  • 3
  • 15
  • 17
0
votes
1 answer

Fail to execute mysql command to restore dump with Apache Commons Exec

My goal is to restore a Mysql dump using mysql command. I'm having a clear difference of behaviour between a code using ProcessBuilder and Apache Commons Exec (1.3). This code works perfectly fine List params = new…
mnementh64
  • 65
  • 1
  • 7
0
votes
1 answer

Trying to use Apache Common exec with bytebuffer to push output from one command to another command in java

My plan is to use ByteBuffer with Apache Common Exec to send output from one command as an input to another command. I am able to do this using PipedOutputStream and PipedInputStream and below is the code which works fine. public static void…
Md Faisal
  • 2,931
  • 8
  • 29
  • 34
0
votes
3 answers

Running shell script from Java

I am trying to run some shell scripts for Java by using commons exec package and clear the STDOUT & STDERR buffers by using PumpStreamHandler. Most of the scripts run fine without any problems but some of them hangs. Particularly those scripts that…
Salman A. Kagzi
  • 3,833
  • 13
  • 45
  • 64
0
votes
0 answers

Apache commons exec causing high CPU usage

Calling a particular executable (Jadeo) via commons-exec (using pipes for it's I/O) is causing massive CPU usage (over 30x) compared to calling same executable from the terminal. Idle wakeups are huge. I've talked to the developer of the executable…
John Baker
  • 89
  • 12
0
votes
1 answer

series of commands using commons-exec

I am new to apache commons-exec. Is there a way I can send a series of commands to a remote machine without authenticating each time? would like to do this order: ssh a@b command1 command2 but apparently commons-exec needs this: ssh a@b \n…
reza
  • 139
  • 1
  • 10
0
votes
2 answers

Unable to get output from Apache Commons Exec

Although the titles are very similar, this questions is NOT a duplicate of Process output from apache-commons exec. I am trying to get the output of a command by using apache-commons exec. Here is what I am doing import…
lakshayg
  • 2,053
  • 2
  • 20
  • 34
0
votes
1 answer

Kill process started by org.apache.commons.executor

I started execution of a testng.xml through apache commons executor libarary by following code: DefaultExecuteResultHandler resultHandler; ExecuteWatchdog watchdog; final Executor executor; resultHandler = new…
Anu Chawla
  • 415
  • 1
  • 4
  • 19
0
votes
1 answer

PumpStreamHandler can capture the process output in realtime

I try to capture a python process output via apache-commons-exec. But it looks like it won't print the output, the output is only displayed after I the python process is finished. Here's my java code CommandLine cmd =…
zjffdu
  • 25,496
  • 45
  • 109
  • 159
0
votes
1 answer

Executing shell-script with parameters using apache.commons.exec in Windows

I am trying to run a script using apache-commons-exec which was implemented using the java approximation to run. This script is executed in the production server (Linux) but I need to test it in my localhost to see that everything works OK. Here is…
mannuk
  • 1,259
  • 5
  • 21
  • 43
0
votes
3 answers

Execute apache-commons-exec multiple commands with semicolon

I'm using apache-commons-exec to execute some commands in a Java application. When I execute 'ls -la /home/user' it works great. But I need to execute something like this ./setEnvsOfTypeXXX.sh; ./setEnvsOfTypeYYY.sh; ls -la /home/user I enter the…
user898384
  • 204
  • 3
  • 6
0
votes
0 answers

Basics questions regarding Runtime.getRuntime().exec()

I learnt Runtime.getRuntime().exec() is used to call external applications from Java. There are processbuilders and apache commons exec which can also be used. But I have few basic questions. How does the sub process creation takes place?. Will it…
Aravind
  • 11
  • 4
0
votes
2 answers

Copy using Apache Commons Exec

I am trying to execute a copy command using Apache Commons API. Below is my effort : String privateKey = "/Users/TD/.ssh/id_rsa"; String currentFile = "/Users/TD/One.txt"; String target = "root@my.server.com:"; // Space is present in…
user2679590
0
votes
1 answer

running simple cmd.exe commands with apache commons exec

I want to run cmd.exe commands from java (for example md C:\blabla to create a new directory C:\blabla ) My code looks like this and it runs without any errors: import java.io.IOException; import org.apache.commons.exec.CommandLine; import…
Selphiron
  • 897
  • 1
  • 12
  • 30