|using CTRL-C event in eclipse [message #188274]
||Mon, 02 February 2004 14:52
| Jiang Yunhong
Registered: July 2009
I am trying test a java program in eclipse for windows. the function of|
the program is:
Using JNI. In the native method, I creat a child-process,which is a
console program, and redirect the child's input and output to a pipe, so
that the native method can read and write to the child process through the
Then the native send a CTRL-C (with GenerateConsoleCtrlEvent) to the
child process, which has set its own CTRL-C handler.
I can't send the CTRL-C event to the child process when I try to run this
program in Eclipse, the error code of GenerateConsoleCtrlEvent , which
means "invalid handle".
However, I can run this program perfect in command line with "java
XXX",where XXX is the class name created by Eclipse.
If I add a AllocConsole() call in the native method, it can still works
quite well in Eclipse, but have a new console window created, which is
what I am trying to avoid .
I think it is because 1 the Eclipse will start the javaw as the VM, which
has no console connected,while the GenerateConsoleCtrlEvent need the
calling process and called process has the same console .Has anyone has
the same experience as me?
I am not still sure what will happen if I use this native functin for
|Re: using CTRL-C event in eclipse [message #188389 is a reply to message #188274]
||Mon, 02 February 2004 17:47
Originally posted by: info.oti.com|
Yunhong Jiang wrote:
> I think it is because 1 the Eclipse will start the javaw as the VM, which
> has no console connected,while the GenerateConsoleCtrlEvent need the
> calling process and called process has the same console .Has anyone has
> the same experience as me?
I can't tell if your problem really is java vs javaw, but it's easy to
test. You can start Eclipse using the -vm argument to specify java
instead of javaw. The simplest way to run java instead of javaw just for
a test is to rename javaw to java_windows or something, and then copy
the java executable to javaw.
IBM Phoenix Labs (OTI)
11811 North Tatum Boulevard, Suite 2400
Phoenix, Arizona, USA 85028-1614
Powered by FUDForum
. Page generated in 0.01696 seconds