• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with running a program from Java file

 
Oz Kron
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to run a program, the program is EXE file written in C#, it should get input from a client in Java, and write to it (simple TCP/IP)
But
When it just doesn't work!
the program get stuck and don't get any thing from the server
But
When I run the server alone (EXE from the command), and connect to it with a client, every thing works fine!
So, what is the problem with "exec" and why isn't it like running a program from the command ?
Thank you
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Runtime.exec has a few pitfalls that you need to avoid. In this case it sounds like you may not be handling the input, error and output streams of the child process. You can read all about how to do that in this article.
 
Oz Kron
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Amm, but what is the problem?
I have done some of the things in the topic you have gave me, but than I can print like only one line, and when sending anther line to the server, it get stuck again like in the first time

 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In that case it would help to see the code you're now using.
 
Oz Kron
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

this is the code
Can some one help me out here?
Thank you
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So what happens exactly if you execute this code? Also, you don't seem to be handling the error stream.
[ August 13, 2007: Message edited by: Ulf Dittmer ]
 
Oz Kron
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happen is for now that if the client send to the server one line, it kind of works, but if there are more lines, it get stuck
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic