Current location: Hot Scripts Forums » Programming Languages » Everything Java » on running external programs from JAVA


on running external programs from JAVA

Reply
  #1 (permalink)  
Old 02-05-05, 04:10 PM
superchritch superchritch is offline
New Member
 
Join Date: Feb 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
on running external programs from JAVA

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 03-09-05, 07:49 PM
conficio conficio is offline
New Member
 
Join Date: Mar 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Hi there,
you can get the information from the documentation of the Runtime.exec() method. It returns a Process object and which has a Project.waitfor() method.

Hope this helps

K<o>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple Java Question JavaNewbie Everything Java 2 02-07-05 10:36 PM
Java Cyclomatic Complexity NICOLAD JavaScript 2 11-08-04 02:11 PM
Re: Porting from java to c++! addit C/C++ 3 09-14-04 05:11 PM
Porting java to C++! addit Everything Java 0 09-06-04 02:03 PM
urgent help-voice chat in java ssblessing Everything Java 1 04-02-04 01:02 PM


All times are GMT -5. The time now is 09:24 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.