aspose file tools*
The moose likes Java in General and the fly likes exec() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "exec()" Watch "exec()" New topic
Author

exec()

Sandeep Advani
Ranch Hand

Joined: Mar 11, 2004
Posts: 78
Can I compile a .java file using Runtime.getRuntime().exec("javac Test.java")? If not, is it possible to do the same?

Thanks.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
It is a bit more complicated than that - you have to consume the stdout and stderr character streams. Read the java.lang.Process JavaDocs.
The use of exec comes up frequently - search the ranch archives.
Bill
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

Or put tools.jar into your classpath, and use the Compiler.class inside.


http://home.arcor.de/hirnstrom/bewerbung
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: exec()