我尝试运行javadoc命令,生成html文件时出现以下错误。我应该更改什么才能生成文档。
我在程序中使用了Javadoc注释/ ** * /。我该怎么做才能解决这个错误?
D:\jdk1.7\bin>javadoc rational.java
Loading source file rational.java...
Constructing Javadoc information...
Standard Doclet version 1.7.0_02
Building tree for all the packages and classes...
Generating \rational.html...
java.lang.IllegalArgumentException
at sun.net.www.ParseUtil.decode(ParseUtil.java:202)
at sun.misc.URLClassPath$FileLoader.<init>(URLClassPath.java:1016)
at sun.misc.URLClassPath$3.run(URLClassPath.java:357)
at sun.misc.URLClassPath$3.run(URLClassPath.java:352)
at java.security.AccessController.doPrivileged(Native Method)
at sun.misc.URLClassPath.getLoader(URLClassPath.java:351)
at sun.misc.URLClassPath.getLoader(URLClassPath.java:328)
at sun.misc.URLClassPath.findResource(URLClassPath.java:171)
at java.net.URLClassLoader$2.run(URLClassLoader.java:551)
at java.net.URLClassLoader$2.run(URLClassLoader.java:549)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findResource(URLClassLoader.java:548)
at java.lang.ClassLoader.getResource(ClassLoader.java:1138)
at java.net.URLClassLoader.getResourceAsStream(URLClassLoader.java:227)
at javax.xml.parsers.SecuritySupport$4.run(SecuritySupport.java:94)
at java.security.AccessController.doPrivileged(Native Method)
at javax.xml.parsers.SecuritySupport.getResourceAsStream(SecuritySupport
.java:87)
at javax.xml.parsers.FactoryFinder.findJarServiceProvider(FactoryFinder.
java:248)
at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:221)
at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:
126)
at com.sun.tools.doclets.internal.toolkit.builders.LayoutParser.parseXML
(LayoutParser.java:88)
at com.sun.tools.doclets.internal.toolkit.builders.ClassBuilder.build(Cl
assBuilder.java:117)
at com.sun.tools.doclets.formats.html.HtmlDoclet.generateClassFiles(Html
Doclet.java:186)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.generateClassFi
les(AbstractDoclet.java:196)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.generateClassFi
les(AbstractDoclet.java:180)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.startGeneration
(AbstractDoclet.java:125)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.start(AbstractD
oclet.java:83)
at com.sun.tools.doclets.formats.html.HtmlDoclet.start(HtmlDoclet.java:6
3)
at com.sun.tools.doclets.standard.Standard.start(Standard.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:280)
at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:160)
at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:397)
at com.sun.tools.javadoc.Start.begin(Start.java:167)
at com.sun.tools.javadoc.Main.execute(Main.java:59)
at com.sun.tools.javadoc.Main.main(Main.java:49)
com.sun.tools.doclets.internal.toolkit.util.DocletAbortException
at com.sun.tools.doclets.internal.toolkit.builders.LayoutParser.parseXML
(LayoutParser.java:95)
at com.sun.tools.doclets.internal.toolkit.builders.ClassBuilder.build(Cl
assBuilder.java:117)
at com.sun.tools.doclets.formats.html.HtmlDoclet.generateClassFiles(Html
Doclet.java:186)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.generateClassFi
les(AbstractDoclet.java:196)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.generateClassFi
les(AbstractDoclet.java:180)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.startGeneration
(AbstractDoclet.java:125)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.start(AbstractD
oclet.java:83)
at com.sun.tools.doclets.formats.html.HtmlDoclet.start(HtmlDoclet.java:6
3)
at com.sun.tools.doclets.standard.Standard.start(Standard.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:280)
at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:160)
at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:397)
at com.sun.tools.javadoc.Start.begin(Start.java:167)
at com.sun.tools.javadoc.Main.execute(Main.java:59)
at com.sun.tools.javadoc.Main.main(Main.java:49)
com.sun.tools.doclets.internal.toolkit.util.DocletAbortException
at com.sun.tools.doclets.formats.html.HtmlDoclet.generateClassFiles(Html
Doclet.java:190)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.generateClassFi
les(AbstractDoclet.java:196)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.generateClassFi
les(AbstractDoclet.java:180)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.startGeneration
(AbstractDoclet.java:125)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.start(AbstractD
oclet.java:83)
at com.sun.tools.doclets.formats.html.HtmlDoclet.start(HtmlDoclet.java:6
3)
at com.sun.tools.doclets.standard.Standard.start(Standard.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:280)
at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:160)
at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:397)
at com.sun.tools.javadoc.Start.begin(Start.java:167)
at com.sun.tools.javadoc.Main.execute(Main.java:59)
at com.sun.tools.javadoc.Main.main(Main.java:49)
rational.java
档案
/**
* Rational number effective representation
* @author Jash Jacob
*/
public class rational
{
/** Constructor for class rational */
public rational(int numerator,int denominator)
{
//some code
}
//** gcd() returns the greatest common divisor */
public static int gcd(int m,int n)
{
//somecode
}
/** tostring() function to return the effective representaion */
public String tostring()
{
//somecode
}
/** main() function takes the numerator and denominator values from the user */
public static void main(String[] args)
{
//some code
}
}