permaculture playing cards*
The moose likes Java in General and the fly likes Help for getting output of Runtime.getRuntime().exec() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Help for getting output of Runtime.getRuntime().exec()" Watch "Help for getting output of Runtime.getRuntime().exec()" New topic
Author

Help for getting output of Runtime.getRuntime().exec()

divya g nair
Greenhorn

Joined: Jan 12, 2009
Posts: 2
I have executed the following command to compile a java program.
Runtime.getRuntime().exec("cmd/c start C:/jdk1.4/BIN/javac filename.java");
i got the class files if there is no errors. But I want to read the errorlist if there any.
My code is like this Anyone can help me please.



thanks in advance
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41181
    
  45
You may want to read in this article to learn about all the issues you need to be aware of when dealing with Runtime.exec.


Ping & DNS - my free Android networking tools app
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38100
    
  22
Please use the CODE button, and maintain indentation.

Use of Runtime.exec() is slightly easier since the introduction of the ProcessBuilder class, but nobody should go near Runtime.exec() without reading the article Ulf quoted.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help for getting output of Runtime.getRuntime().exec()
 
Similar Threads
Running java program from another java program
waitfor on a process
Runtime.getRuntime() help plzzzzzzzz
How to run .java file from Runnable
Runtime.getRuntime().exec() from JSP page