Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top