runtime.exec Questions
1
Solved
I have a command that I need to run in java along these lines:
C:\path\that has\spaces\plink -arg1 foo -arg2 bar "path/on/remote/machine/iperf -arg3 hello -arg4 world"
This command works fine w...
Heist asked 17/6, 2013 at 6:44
3
Solved
I'm trying to run a .bat file and get the output. I can run it but I can't get the results in Java:
String cmd = "cmd /c start C:\\workspace\\temp.bat";
Runtime r = Runtime.getRuntime();
Process ...
Whitening asked 12/6, 2013 at 8:47
2
I am working on a program which takes a user input and generates an output as a map projection plot.
The easiest map projection library that I have found is matplotlib-basemap, written in python a ...
Carnet asked 22/4, 2013 at 8:5
2
Solved
Process p = Runtime.getRuntime().exec("sh somescript.sh &> out.txt");
I am running this command using Java. The script is running but it's not redirecting its stream to the file. Moreover,...
Soapbark asked 26/4, 2013 at 14:17
6
Solved
I'm fighting the spaces bug in Java's Runtime exec method. Here's what's unique about this problem: the command I'm trying to execute is an incoming string and may or may not have spaces and is not...
Winthrop asked 1/11, 2010 at 16:28
1
Solved
I was running a Perl script that replaces a string with another:
perl -pi.back -e 's/str1/str2/g;' path/to/file1.txt
When I run this command from terminal it well replaces all the occurrences o...
Benitobenjamen asked 24/12, 2012 at 13:38
5
Solved
In "C", I can run a long blocking process in the background (AND HAVE IT CONTINUE TO RUN) after the starting process has exited.
void main(void)
{
system("some_long_blocking_process &");
exi...
Martial asked 5/10, 2011 at 17:24
4
Solved
I'm launching wkhtmltopdf from within my Java app (part of a Tomcat server, running in debug mode within Eclipse Helios on Win7 64-bit): I'd like to wait for it to complete, then Do More Stuff.
Str...
Waziristan asked 31/3, 2011 at 20:59
1
Solved
I am using Runtime.getRuntime().exec() to run a shell script from Java code. The code works fine when I pass the parameter as string
Runtime.getRuntime().exec("sh test.sh")
Since I have...
Hobgoblin asked 11/10, 2012 at 6:7
3
I am executing a shell script from Java program. I have implemented it using Runtime class. Below is the code I implemented
final StringBuilder sb = new StringBuilder("test.sh");
sb.append("/path ...
Define asked 10/10, 2012 at 5:12
10
Solved
On my system I can't run a simple Java application that start a process. I don't know how to solve.
Could you give me some hints how to solve?
The program is:
[root@newton sisma-acquirer]# cat ...
Catalepsy asked 14/7, 2009 at 11:20
1
Solved
I have been through the StreamGobbler and I understand the usage and the reason on why it has been implemented. However the scenarios covered are only those wherein there could be an output from th...
Durr asked 4/9, 2012 at 6:56
1
Solved
I have to write a Test case in JUnit for a Class lets call it C1 which internally calls Runtime.getRuntime.exit(somevalue).
The class C1 has a main method which accepts some arguments and the crea...
Sudbury asked 16/7, 2012 at 13:14
3
Solved
I have the following line to run a batch file,
Process process = Runtime.getRuntime().exec("cmd /c start rake.bat");
But I want it to run in the background and not display the command line to t...
Ryun asked 9/7, 2012 at 11:46
1
Solved
My program is running on ubuntu 10.04 ,and here is the code :
Process process=Runtime.getRuntime().exec("ls",null,null);
it throw an exception of :
Cannot run program "ls": java.io.IOException...
Ivanovo asked 14/6, 2012 at 11:17
6
How to execute a java program with the help of Runtime.getRuntime().exec().
For example we shall have the java file path as c:/java/abc.java. Please help me with the code.
Dicta asked 3/2, 2009 at 6:9
4
Solved
So, I am building a program that converts .flv files to other formats.
For that I'm using ffmpeg which does its job perfectly when executing it via command line. For example:
ffmpeg -i C:\test.flv...
Nutriment asked 26/3, 2012 at 12:12
1
Solved
I'm writing a Java program MyAwesomeProgram that uses Process' exec function to run bash commands locally. My code is located in /home/a/b/c, and there are .sh files located in /home/a/b/d that I n...
Canonicals asked 10/4, 2012 at 18:2
4
Solved
I am wondering is there any way to execute following shell script, which waits for user input using java's Runtime class?
#!/bin/bash
echo "Please enter your name:"
read name
echo "Welcome $name"...
Lentil asked 29/3, 2012 at 14:29
2
Solved
I created an executable jar and executed it using process builder from another java program. Here's my code -
public class SomeClass {
public static void main(String[] args) {
Process p = null;
...
Tetrapod asked 9/2, 2012 at 3:37
3
Solved
So I want to be able to write an app that can turn on and display logcat messages, dmesg, and also be able to run commands like 'ls' 'cat' 'echo' 'cd.'
If I do the following:
nativeProc = Runtime...
Connection asked 6/1, 2011 at 18:57
2
Solved
Is it possible to pass the output of one process created by ProcessBuilder to another process created by another ProcessBuilder? For example, if I'm trying to execute this shell command:
ls | grep...
Siding asked 5/1, 2012 at 20:44
4
Solved
Possible Duplicate:
How do I set environment variables from Java?
I'm trying to set an environment variable, and read it back to verify it was actually set.
I've got the following : ...
Matrices asked 22/12, 2011 at 16:55
1
Solved
I am trying to start a Lisp Image from Java in Mac OSX. Using the Image from my console I type the following:
lisp_image --eval '(package::method "some_argument")'
everything runs fine.
In Java...
Richmond asked 7/12, 2011 at 9:46
4
Solved
This might already been answered before but that was regarding unicode and I don't think this is unicode (it's in ASCII so...).
When I execute this in my terminal there is no problem what so ever
...
Sabbat asked 11/5, 2011 at 19:43
© 2022 - 2024 — McMap. All rights reserved.