File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How can I call an external program in the java?
 
Similar Threads
Executing External Command with a Twist
How to invoke an external program in java application?
Java-Generic Interface
Call executable program
invoke class packed in external jar