This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Threads and Synchronization and the fly likes create process problem Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "create process problem " Watch "create process problem " New topic
Author

create process problem

Ke Li
Greenhorn

Joined: Feb 17, 2004
Posts: 2
Hi All,
I am trying to call another software from my java program. And the
source code is:
Runtime r = Runtime.getRuntime();
Process p = null;
try {
p = r.exec("racer.exe");
}catch (Exception e) {
System.out.print(e.getMessage());
}
The software "racer.exe" must be started in MS-DOS environment and I
compile and execute my java program also in MS-DOS environment. Now
the problem is there is no error displayed when the program is
complied and executed. But actually the software "racer.exe" is not
activated. With the same code, I tried to call other software running
on Windows environment and it works. I don't know what the problem.
Does it because the software and my program both runs on MS-Dos
environment? Could you please give me some ideas?
Thanks a lot,
Best Regards,
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18670
Chances are there's an error message for you on the Process' error stream. This is something you have to read yourself with getErrorStream(). But this is best done from a separate thread, since you also (usually) need to read from standard output using getInputStream() and this may be simultaneous. A good solution is presented in this JavaWorld article on common exec() problems. Hope that helps...


"I'm not back." - Bill Harding, Twister
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: create process problem
 
Similar Threads
Problem in starting tomcat
Launching a DOS batch file
TomCat 3.0
environment variable problem
create process problem