Click here to Skip to main content
15,912,665 members
Home / Discussions / Java
   

Java

 
AnswerRe: bytecode_programming Pin
Richard MacCutchan19-Jan-11 21:52
mveRichard MacCutchan19-Jan-11 21:52 
GeneralRe: bytecode_programming Pin
David Skelly19-Jan-11 22:36
David Skelly19-Jan-11 22:36 
GeneralRe: bytecode_programming Pin
Richard MacCutchan20-Jan-11 1:34
mveRichard MacCutchan20-Jan-11 1:34 
AnswerRe: bytecode_programming Pin
Cedric Moonen19-Jan-11 22:19
Cedric Moonen19-Jan-11 22:19 
AnswerRe: bytecode_programming Pin
David Skelly19-Jan-11 22:29
David Skelly19-Jan-11 22:29 
AnswerRe: bytecode_programming Pin
_Erik_20-Jan-11 3:48
_Erik_20-Jan-11 3:48 
AnswerRe: bytecode_programming Pin
Nagy Vilmos20-Jan-11 4:56
professionalNagy Vilmos20-Jan-11 4:56 
Questionthread does not return from Runtime.exec Pin
WernerP19-Jan-11 1:55
WernerP19-Jan-11 1:55 
Hi,

I'm new to using Runtime.getRuntime().exec on WindowsXP, JRE 6.
Solution should work on all Windows NT from 5 upwards and common UNIX.

I called it in the following way
process = Runtime.getRuntime().exec(cmdargs);

where

cmdargs[0] = "D:\Somepath\NmMutex"
cmdargs[1] = "lock"

Program NmMutex with argument lock runs until its process is stopped externally.

When
Runtime.getRuntime().exec(cmdargs);
is called, the calling thread remains suspended, until program NmMutex is killed.

Is that the normal behaviour of Runtime.exec? I thought the calling thread would return, even if the program it started is still running, so I can observe the prog by reading its stdout and stderr from my Java app. If not it would return there would be no process created and I could not observe the program.

Which way is best to solve that? Start prog in Background, like
process = Runtime.getRuntime().exec("start /B NmMutex lock");
resp.
process = Runtime.getRuntime().exec("& NmMutex lock");
?

Thank you
Werner
AnswerRe: thread does not return from Runtime.exec Pin
Peter_in_278019-Jan-11 12:31
professionalPeter_in_278019-Jan-11 12:31 
GeneralRe: thread does not return from Runtime.exec Pin
WernerP19-Jan-11 12:52
WernerP19-Jan-11 12:52 
GeneralRe: thread does not return from Runtime.exec Pin
Peter_in_278019-Jan-11 13:07
professionalPeter_in_278019-Jan-11 13:07 
GeneralRe: thread does not return from Runtime.exec Pin
WernerP19-Jan-11 23:27
WernerP19-Jan-11 23:27 
GeneralRe: thread does not return from Runtime.exec Pin
WernerP20-Jan-11 6:32
WernerP20-Jan-11 6:32 
QuestionAbout Calculate.... Pin
Khalil Adam19-Jan-11 0:45
Khalil Adam19-Jan-11 0:45 
AnswerRe: About Calculate.... lt compiles but the calculating is always false......could someone help me to correct this code..... Pin
Cedric Moonen19-Jan-11 1:35
Cedric Moonen19-Jan-11 1:35 
GeneralRe: About Calculate.... Pin
Khalil Adam19-Jan-11 2:31
Khalil Adam19-Jan-11 2:31 
GeneralRe: About Calculate.... lt compiles but the calculating is always false......could someone help me to correct this code..... Pin
Cedric Moonen19-Jan-11 2:59
Cedric Moonen19-Jan-11 2:59 
GeneralRe: About Calculate.... Pin
Khalil Adam19-Jan-11 3:10
Khalil Adam19-Jan-11 3:10 
GeneralRe: About Calculate.... lt compiles but the calculating is always false......could someone help me to correct this code..... Pin
Richard MacCutchan19-Jan-11 3:14
mveRichard MacCutchan19-Jan-11 3:14 
GeneralRe: About Calculate.... Pin
Khalil Adam19-Jan-11 3:26
Khalil Adam19-Jan-11 3:26 
GeneralRe: About Calculate.... Pin
Cedric Moonen19-Jan-11 3:29
Cedric Moonen19-Jan-11 3:29 
GeneralRe: About Calculate.... Pin
Khalil Adam19-Jan-11 3:45
Khalil Adam19-Jan-11 3:45 
GeneralRe: About Calculate.... Pin
Cedric Moonen19-Jan-11 3:58
Cedric Moonen19-Jan-11 3:58 
GeneralRe: About Calculate.... Pin
Khalil Adam19-Jan-11 4:14
Khalil Adam19-Jan-11 4:14 
GeneralRe: About Calculate.... Pin
Richard MacCutchan19-Jan-11 5:19
mveRichard MacCutchan19-Jan-11 5:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.