我正在尝试通过 UmlGraph 从源代码生成类图。我已经构建并创建了 umlgraph.jar,但是当我在我的项目中使用它时,它给了我以下错误::
[javadoc] java.io.IOException: Cannot run program "dot": CreateProcess error=2, The system cannot find the file specified
[javadoc] at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
[javadoc] at java.lang.Runtime.exec(Runtime.java:593)
[javadoc] at java.lang.Runtime.exec(Runtime.java:466)
[javadoc] at org.umlgraph.doclet.UmlGraphDoc.runGraphviz(UmlGraphDoc.java:131)
[javadoc] at org.umlgraph.doclet.UmlGraphDoc.generatePackageDiagrams(UmlGraphDoc.java:95)
[javadoc] at org.umlgraph.doclet.UmlGraphDoc.start(UmlGraphDoc.java:63)
[javadoc] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[javadoc] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[javadoc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[javadoc] at java.lang.reflect.Method.invoke(Method.java:597)
[javadoc] at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:269)
[javadoc] at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:143)
[javadoc] at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:340)
[javadoc] at com.sun.tools.javadoc.Start.begin(Start.java:128)
[javadoc] at com.sun.tools.javadoc.Main.execute(Main.java:41)
[javadoc] at com.sun.tools.javadoc.Main.main(Main.java:31)
我已经下载了 GraphViz 并设置了 Graphviz 的路径。请帮帮我,我是新手。
ant 文件中的 javadoc 目标::
<fileset dir="${srcroot.dir}" >
<filename name="**/*.java"/>
</fileset>
<doclet name="org.umlgraph.doclet.UmlGraphDoc"
path="${umlLib.dir}/UmlGraph.jar">
<param name="-attributes" />
<param name="-operations" />
<param name="-qualify" />
<param name="-types" />
<param name="-visibility" />
</doclet>
</javadoc>
<apply executable="dot" dest="${reports.dir}" parallel="false">
<arg value="-Tpng"/>
<arg value="-o"/>
<targetfile/>
<srcfile/>
<fileset dir="${reports.dir}" includes="*.dot"/>
<mapper type="glob" from="*.dot" to="*.png"/>
</apply>
</target>