Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Java
Expertise: Advanced
Feb 20, 2001

Execute an External Program Without Using JNI


The secret lies in the Runtime class. Runtime contains the method exec, which takes the basic form of:
 
Process exec(String command) or
Process exec(String[] comdarray) or
Process exec(String[] cmdarray, String[] envp, File dir)

Where command is the name of the executable, comdarray contains the exe name and arguments, envp contains the environment variables, and File contains the file name. exec returns the abstract object Process, whose getInputStream() and getOutputStream() can be used to collect I/O information on the running process.
Tanzim Husain
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date