The Runtime.exec() method allows Java apps. to create a new OS Process.

learn more… | top users | synonyms

0
votes
1answer
28 views

Using Runtime.getRuntime().exec() to run perl code in java

I have a perl script called pbp that takes an html file as an argument and then creates an output file. Here is my current code. Infile is obtained earlier from a JFile Chooser. I don't get any errors ...
-1
votes
0answers
44 views

Execute a file hiddenly in Java?

I would like to execute an ".exe" file in Windows over Java. I have the following code: File file = new File("res/file.exe"); try { Runtime.getRuntime().exec("rundll32 SHELL32.DLL,ShellExec_RunDLL ...
0
votes
2answers
35 views

Running the Bin file with get.Runtime.exec()?

This the C++ code for hello.exe: #include<iostream.h> #include<conio.h> int main() { cout<<"Hello world\n"; getch(); cout<<"I bypass error\n"; return 0; } I need to ...
0
votes
2answers
42 views

Execute java prog without Runtime.exec()? Does any “JavaExecutor” exist?

Is there any way to run a Java program from inside another Java program without using Runtime exec? Is there some kind of JavaExecutor tool which one could use with a DiagnosticCollector? (Like ...
0
votes
1answer
31 views

Using Runtime.exec() with String [ ]

I am trying to execute a bash script that gets passed 4 arguments from java. I can execute the script without the arguments perfectly using this code: try { String ...
1
vote
3answers
93 views

Start a process with Java [duplicate]

Recently I am stuck with a Java program. My requirement is, I have to restart my snmp service through java code in my Ubuntu machine. Normally We can do the same with ...
0
votes
0answers
32 views

Runtime.getRuntime().exec() issue with stty command

I'm trying to detect the availability of the "stty" command in Java. I tried to use this code: boolean hasSttyAvailable() { Process process = Runtime.getRuntime().exec(new String[] {"/bin/sh", ...
0
votes
2answers
52 views

Not getting any output after calling C executable file from Java code

I am trying to execute the C code from Java code which is already compiled and executed, but, I am not getting any output from the executable file. Can anyone help me to complete this task? Code is ...
0
votes
0answers
17 views

Runtime.getRuntime().waitfor() ; error with long string

i am trying to use this command from java program Runtime.getRuntime().waitfor() ; i am using tts to convert a test to audio. the problem is it has 4 arguments, and the last argument is the ...
2
votes
1answer
82 views

Run execute file in Runtime.exec() and get user input

How to run c execute file with user input in Java Runtime().exec(). Without user input in my c program execute file runs in Runtime().exec(): For example: Below c program if n is predefined and ...
0
votes
2answers
40 views

Change content of batch file

How to change content of batch file using Java code? I worked with parsing XML using Java program. It worked fine. But can I do same for the batch file using Java? I am able to run batch file using ...
-1
votes
1answer
29 views

Restart Unix service

I have Ubuntu in my machine where I have installed snmpd. To start stop I use below command: service snmpd start service snmpd stop Now I have to execute this comments from java. I have tried with ...
0
votes
2answers
42 views

Java process.waitFor() does not return

On Windows 7 64 bit, running 64 bit Java 1.7.0_17 , the p.waitFor() shown below never returns. String move_command="cmd.exe /c xcopy /Y /E "+x86_release+" "+path+"\\"; Process p; p = ...
0
votes
0answers
54 views

make a simple java program that runs command prompt commands from the java program somewhat similar to jCreator

I am trying to make a simple java program that runs command prompt commands from the java program somewhat similar to jCreator.in here I only wanted to compile and run the relavant main class. this ...
0
votes
3answers
62 views

Pass a string with spaces to an execute command in Java to execute a bash script

How do I pass a string with spaces to an execute command in Java to execute a bash script? I'm trying to use a script to generate and send a email using the unix mail command but it ignores the ...

1 2 3 4 5 31
15 30 50 per page