The moose likes Beginning Java and the fly likes On running external programs in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "On running external programs in java" Watch "On running external programs in java" New topic

On running external programs in java

christine clarin
Ranch Hand

Joined: Feb 05, 2005
Posts: 106
hi, i need some help with my code, i'm trying to run several .exe files, i am currently using Runtime.getRuntime().exec. It works fine with the first exe command, however it stops there and does not perform the other commands following it.
here is a sample of my code:
Runtime p = Runtime.getRuntime();
p.exec("randinit -din skin.dat -cout skin.cod -xdim 100 -ydim 96 -topol hexa -neigh bubble -rand 123");
System.out.println ("Initialization Done");
//first map training
Runtime p1 = Runtime.getRuntime();
p1.exec("vsom -din skin.dat -cin skin.cod -cout skin.cod -rlen 1000 -alpha 0.05 -radius 10");
System.out.println ("First Training Done");
this either only runs the initialization part but does not perform the training part or it performs both simultaneously, therefore not producing the correct results since what i need is for them to run one after the other. How can i do this? please help. thank you very much.
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24193

Please don't post the same question in multiple forums. It just wastes people's time. I'm closing this duplicate thread.

[Jess in Action][AskingGoodQuestions]
I agree. Here's the link:
subject: On running external programs in java
jQuery in Action, 3rd edition