我正在使用Intellij Idea,当我开始生成JavaDocs(通过Tools - > Generate JavaDoc)时,我会抛出一个IllegealArgumentException而没有关于出错的信息.
即使没有JavaDoc注释,在使用模块中的每个单独文件进行测试时也会发生这种情况.
这是我得到的堆栈跟踪的示例:
java.lang.IllegalArgumentException at sun.net.www.ParseUtil.decode(ParseUtil.java:202) at sun.misc.URLClassPath$FileLoader.(URLClassPath.java:1204) at sun.misc.URLClassPath$3.run(URLClassPath.java:525) at sun.misc.URLClassPath$3.run(URLClassPath.java:520) at java.security.AccessController.doPrivileged(Native Method) at sun.misc.URLClassPath.getLoader(URLClassPath.java:519) at sun.misc.URLClassPath.getLoader(URLClassPath.java:492) at sun.misc.URLClassPath.getNextLoader(URLClassPath.java:457) at sun.misc.URLClassPath.access$100(URLClassPath.java:64) at sun.misc.URLClassPath$1.next(URLClassPath.java:239) at sun.misc.URLClassPath$1.hasMoreElements(URLClassPath.java:250) at java.net.URLClassLoader$3$1.run(URLClassLoader.java:601) at java.net.URLClassLoader$3$1.run(URLClassLoader.java:599) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader$3.next(URLClassLoader.java:598) at java.net.URLClassLoader$3.hasMoreElements(URLClassLoader.java:623) at sun.misc.CompoundEnumeration.next(CompoundEnumeration.java:45) at sun.misc.CompoundEnumeration.hasMoreElements(CompoundEnumeration.java:54) at java.util.ServiceLoader$LazyIterator.hasNextService(ServiceLoader.java:354) at java.util.ServiceLoader$LazyIterator.hasNext(ServiceLoader.java:393) at java.util.ServiceLoader$1.hasNext(ServiceLoader.java:474) at javax.xml.parsers.FactoryFinder$1.run(FactoryFinder.java:293) at java.security.AccessController.doPrivileged(Native Method) at javax.xml.parsers.FactoryFinder.findServiceProvider(FactoryFinder.java:289) at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:267) at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:127) at com.sun.tools.doclets.internal.toolkit.builders.LayoutParser.parseXML(LayoutParser.java:89) at com.sun.tools.doclets.internal.toolkit.builders.ClassBuilder.build(ClassBuilder.java:120) at com.sun.tools.doclets.formats.html.HtmlDoclet.generateClassFiles(HtmlDoclet.java:189) at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.generateClassFiles(AbstractDoclet.java:205) at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.generateClassFiles(AbstractDoclet.java:189) at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.startGeneration(AbstractDoclet.java:137) at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.start(AbstractDoclet.java:82) at com.sun.tools.doclets.formats.html.HtmlDoclet.start(HtmlDoclet.java:80) 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:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:310) at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:189) at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:366) at com.sun.tools.javadoc.Start.begin(Start.java:219) at com.sun.tools.javadoc.Start.begin(Start.java:205) at com.sun.tools.javadoc.Main.execute(Main.java:64) at com.sun.tools.javadoc.Main.main(Main.java:54) javadoc: error - java.lang.IllegalArgumentException
据我所知,它并没有真正告诉我很多关于实际错误的信息.这是我尝试为以下内容生成JavaDocs的示例文件:
package Network; public class NetworkTags { public static final String OPEN_TAG = "<"; public static final String CLOSE_TAG = "/>"; public static final String NET_OPEN_TAG = ""; public static final String NET_CLOSE_TAG = " "; public static final String VERTEX_TAG = "VERTEX"; public static final String EDGE_TAG = "EDGE"; public static final String REL_TAG = "REL"; public static final String TYPE_TAG = "TYPE"; public static final String COST_TAG = "COST"; public static final String NAME_TAG = "NAME"; public static final String SOURCE_TAG = "SOURCE"; public static final String TARGET_TAG = "TARGET"; public static final String FROM_TAG = "FROM"; public static final String TO_TAG = "TO"; }
使用Java 8和IntelliJ IDEA 2016.1.1
我有同样的问题.你shold删除CLASSPATH环境变量.