Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JSDoc without Java?

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?

like image 730
streetlight Avatar asked Aug 05 '13 14:08

streetlight


2 Answers

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.

  • At least on Linux, as long as java is in the path, you can safely ignore that error and it will still generate.
  • see this question for some other discussion about JAVA_HOME and grunt-jsdoc-plugin
like image 179
explunit Avatar answered Sep 26 '22 18:09

explunit


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"
like image 24
Matthew Rankin Avatar answered Sep 26 '22 18:09

Matthew Rankin