aspose file tools*
The moose likes Java in General and the fly likes Console application executing from Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Console application executing from Java " Watch "Console application executing from Java " New topic
Author

Console application executing from Java

Imre Tokai
Ranch Hand

Joined: Jun 04, 2008
Posts: 130
Hello!


I'm executing a C++ application that contains GUI from Java via Runtime.getRuntime().exec( cmd ), and it's working properly.
When I want to execute C++ console application it doesn't seem to return information that it's finished and remains to hang.
Even C++ code part behaved as expected.

Here is the whole example:



How to call the C++ console application from Java properly, with notification that will avoid hanging?


Regards
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42292
    
  64
I don't see any code that would handle the process' input, output and error streams. Read and follow the article "When Runtime.exec() doesn't" by Daconta; it explains all this.


Ping & DNS - my free Android networking tools app
 
Consider Paul's rocket mass heater.
 
subject: Console application executing from Java