views:

35

answers:

1

I am attempting to programmatically generate javadocs via an instance of Runtime through the exec() method by passing in the commands necessary to generate javadocs. First of all I am unfamiliar with creating javadocs via the command line and second I am unfamiliar with the exec() method from Runtime. As a test I was able to execute executables compiled from C# classes through the exec() command but was not able to do so with executables compiled from C++ classes, what is causing this behavior? Also, I was unable to execute the javadoc.exe file via the exec() command while pointing to the JDK bin directory. How can I generate javadocs via exec() arguments, and is it even possible to do so? Thanks.

+2  A: 

It should certainly be possible to do that.

There are some traps associated with Runtime.exec. For example, if you don't consume the standard error and standard out streams then any executed process will block.

It is also worth noting that not everything you can execute on a console is an executable. System commands like "echo" will not work.

Synesso
Yeah, from what I have seen it seems to only be able to execute win32 executables. I tried running runnable jars and batch files and it seemed not to work as intended.
Vapen
The 'java.exe' executable should work.
Synesso