I'm trying to incorporate JSDoc into my Grunt deployment process. When I run it, I get the following error (expectedly):
>> JAVA_HOME is not set. Jsdoc requires Java to run.
Fatal error: Bad argument
I know that JSDoc is java-based, but I'm hoping to remove Java from the equation wholly. Is there a way to do this with the existing grunt plugin, or another that runs the process in Node only?
I don't want to add Java just for one task. Is this a fool's errand?
There's no way to do this from the current grunt jsdoc plugin. The issue is with the underlying jsdoc utility of course. You can track their progress toward supporting node.js instead of Rhino here:
https://github.com/jsdoc3/jsdoc/issues/93
However, a couple notes about that error you're seeing.
java
is in the path, you can safely ignore that error and it will still generate.The JSDoc dependency on Java, required by Mozilla Rhino, has been removed in JSDoc 3.3.0. The JSDoc GitHub page states:
Native support for Node.js is available in JSDoc 3.3.0 and later. JSDoc supports Node.js 0.10 and later.
JSDoc v3.3.0 is still in alpha release status (3.3.0-alpha4 was released on Jan 26, 2014), so to install the latest alpha version use:
npm install jsdoc@"<=3.3.0"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With