• Post Reply Bookmark Topic Watch Topic
  • New Topic

System Commands - Running programs in other languages  RSS feed

 
Toulouse Laurent
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I am writing a program that runs a system command (i.e. exec method) to run another program I have written in "C". It is not able to work. The C program works fine by itself, but when I try to run it through "exec" method in the Runtime Class it won't work. I think it's an IO issues but I am not sure.
Has anyone tried to run a program written in C from a JAVA system command. How did you get it to work?
Note: I wrote a perl script that did the same thing and it works fine, so I know it's a JAVA issue.
Thanks.
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The facts you give don't point conclusively to a Java issue -- at least not for me. Whether a program is written in C, Pascal, FORTRAN or whatever doesn't matter. And if there is a difference between running System.exec() against a shell script or a binary, I haven't come across it.
The more likely place to start: are you sure the C program writes its output to stdout? You can test this by redirecting stderr traffic to a file.
We're just talking about this stuff now over in the Linux/Unix forum -- go take a peek.
------------------
Michael Ernest, co-author of: The Complete Java 2 Certification Study Guide
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!