File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Call other windows program from Java program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Call other windows program from Java program" Watch "Call other windows program from Java program" New topic
Author

Call other windows program from Java program

Marco Yeung
Greenhorn

Joined: Sep 21, 2001
Posts: 5
Dear all,
How can I use pure Java program to call Windows programs(.exe)? e.g notepad.exe. Is there any package available in JDK?
thanks
Marco
Peter Tran
Bartender

Joined: Jan 02, 2001
Posts: 783
Marco,
You can use one of the various java.lang.Runtime.exec() methods. *WARNING* Using this method will probably make your code platform depedent. Using exec() is not JAVA friendly.
For example, there is no way for me to run your application on a UNIX box if it's going to try to kick off a notepad.exe application.
-Peter
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Call other windows program from Java program