How to pass environment variable to javadoc process

I’m trying to pass an environment variable to the process that runs javadoc using the javadoc task. I can’t find any API that lets me do that though. Test tasks have an environment method I can call. Is there something similar for javadoc?