File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Console application executing from Java " Watch "Console application executing from Java " New topic

Console application executing from Java

Imre Tokai
Ranch Hand

Joined: Jun 04, 2008
Posts: 130

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?

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
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.
I agree. Here's the link:
subject: Console application executing from Java
It's not a secret anymore!