Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Console application executing from Java

 
Imre Tokai
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic