File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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: 39551
    
  27
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 - updated with new look and Ping home screen widget
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Console application executing from Java
 
Similar Threads
where the code is going wrong
ProgressMonitorInputStream problem
Works on Windows and not Solaris, Why?
aligning label and fields in Swing
how to implement mvc or observer pattern on this java code ?