wood burning stoves 2.0*
The moose likes Java in General and the fly likes calling another program from Java Application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "calling another program from Java Application" Watch "calling another program from Java Application" New topic
Author

calling another program from Java Application

Rashmi Trivedi
Ranch Hand

Joined: Aug 13, 2001
Posts: 60
Hi all
I was wondering if i can do this. I have writteen one java application that converts data metric to imperial and wirte to another file. The program is working fine but what i would like to do is, once i write data back to the file i would like to call another program and end java applicatlion. OR i should say wake up another program to do the rest. The another program could in C++ or VB, i am not sure yet.
I think it is possible however i couldn't find much information on that topic. I would really appreciate if you guys can assist me in this matter.
Looking forward to hearing from you shortly.
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
You might be able to use Runtime.exec(). But really this is a job for batch files (Win)/shell scripts (*nix). You can use the exit status to control program flow through the script.
- Peter
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Runtime.getRuntime().exec("whatever.exe inputfile.txt"); //start the new process
System.exit(0); //end this process


"JavaRanch, where the deer and the Certified play" - David O'Meara
Rashmi Trivedi
Ranch Hand

Joined: Aug 13, 2001
Posts: 60
Dear Peter and Cindy
Thank you for your assistance. I will try your suggestion and let you know how it goes.
Thank you once again.
Regards,
Rashmi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: calling another program from Java Application
 
Similar Threads
Software that manipulates XML files
Reading a text file whilst it is in use
PDF opening
Meta Stock data ?? Anyone?
Meta Stock data ?? Anyone?