my dog learned polymorphism*
The moose likes Java in General and the fly likes How can I call an external program in the java?  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How can I call an external program in the java?  " Watch "How can I call an external program in the java?  " New topic
Author

How can I call an external program in the java?

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
How can I call an external program in the java?

Ex: to call notepad.exe in the java
Philip Shanks
Ranch Hand

Joined: Oct 15, 2002
Posts: 189
I guess you are talking about accessing the exec() method of the java.lang.Runtime class. Below is a bit of example code that should do what you are describing. Please note that I am working on a Linux system, and used "rxvt" as my system call. You should be able to substitute "notepad.exe" for this without much trouble.
Please check the API documentation for more details.


Philip Shanks, SCJP - Castro Valley, CA
My boss never outsources or has lay-offs, and He's always hiring. I work for Jesus! Prepare your resume!
 
wood burning stoves
 
subject: How can I call an external program in the java?