Problem when getting the process of execution of JAVAWS on PC

Hello,

I give here a part of my code:

boolean stillrunning = true;

Process p =null;

while (stillrunning)

{

try

{

p=Runtime.getRuntime().exec(javawsPath + "javaws " + portalURL_);

}

catch (Exception ext)

{

printException(ext);

}

try{

int g = p.exitValue();

stillrunning = false;

}

catch(IllegalThreadStateException ex)

{

printException(ex);

}

}

The process of javaws is running normally on my Pc (Win Xp), but I have always stillrunning to false, it seems that the process p is killed but the javaws is still running.

Can you help me? how can I get the Process p?

Best regards

[741 byte] By [thread_linuxa] at [2007-11-26 17:06:46]
# 1
Please use code formatting tags.Also, I got lost in your description of the problem. What is set to false? What is running? Please clarify.
zadoka at 2007-7-8 23:34:34 > top of Java-index,Desktop,Deploying...
# 2

Hello,

Ok , I put the part that causes a problem to me :

============================

Process p = null;

boolean stillrunning= true;

try{

p=Runtime.getRuntime().exec(javawsPath + "javaws " + portalURL_);

}

catch (Exception ext)

{

printException(ext);

}

try{

int g = p.exitValue();

stillrunning = false;

}

catch(IllegalThreadStateException ex)

{

printException(ex);

}

==========================

The value of "stillrunning" is always "false", the process p is killed, however the application "javaws" is running.

The value of exit is 0,

Is it a normal behaviour?

My purpose is to get the id of the process of javaws that I have launched, have you any idea how to get it.

Thank you

thread_linuxa at 2007-7-8 23:34:34 > top of Java-index,Desktop,Deploying...
# 3
the problem occurs only on Pc (win xp) and not on Linux.
thread_linuxa at 2007-7-8 23:34:34 > top of Java-index,Desktop,Deploying...
# 4
Hello i have the same problem, you six successful one to resolve? nobody gives to us of the answers?there are some things of the java that they make me to suspect, perhaps do not want to admit that they exist of the bug in jvm.
nturria at 2007-7-8 23:34:34 > top of Java-index,Desktop,Deploying...
# 5

The javaws process is a short lived process that just determines the right version of java to launch, and exec's it with the right args to run the application under Java Web Start.

The process that continues to run for the duration of the application is javaw.exe (on windows).

/Andy

dietz333a at 2007-7-8 23:34:34 > top of Java-index,Desktop,Deploying...
# 6
Yuo are an example of javaws process launch?
nturria at 2007-7-8 23:34:34 > top of Java-index,Desktop,Deploying...