Eclipse JavaDoc Generation falla con IllegalArgumentException?

Cuando bash exportar o generar un javadoc para cualquiera de mis clases comentadas de javadoc, siempre recibía un error, hasta hace poco, en el que acababa de generar archivos html completamente vacíos.

Este es el error que estaba recibiendo antes:

Constructing Javadoc information... Standard Doclet version 1.7.0_03 Building tree for all the packages and classes... Generating C:\Users\James\Workspace\TestCLASS.html.… java.lang.IllegalArgumentException at sun.net.www.ParseUtil.decode(ParseUtil.j… at sun.misc.URLClassPath$FileLoader.(… at sun.misc.URLClassPath$3.run(URLClassPath… at sun.misc.URLClassPath$3.run(URLClassPath… at java.security.AccessController.doPrivile… Method) at sun.misc.URLClassPath.getLoader(URLClass… at sun.misc.URLClassPath.getLoader(URLClass… at sun.misc.URLClassPath.findResource(URLCl… at java.net.URLClassLoader$2.run(URLClassLo… at java.net.URLClassLoader$2.run(URLClassLo… at java.security.AccessController.doPrivile… Method) at java.net.URLClassLoader.findResource(URL… at java.lang.ClassLoader.getResource(ClassL… at java.net.URLClassLoader.getResourceAsStr… at javax.xml.parsers.SecuritySupport$4.run(… at java.security.AccessController.doPrivile… Method) at javax.xml.parsers.SecuritySupport.getRes… at javax.xml.parsers.FactoryFinder.findJarS… at javax.xml.parsers.FactoryFinder.find(Fac… at javax.xml.parsers.SAXParserFactory.newIn… at com.sun.tools.doclets.internal.toolkit.b… at com.sun.tools.doclets.internal.toolkit.b… at com.sun.tools.doclets.formats.html.HtmlD… at com.sun.tools.doclets.internal.toolkit.A… at com.sun.tools.doclets.internal.toolkit.A… at com.sun.tools.doclets.internal.toolkit.A… at com.sun.tools.doclets.internal.toolkit.A… at com.sun.tools.doclets.formats.html.HtmlD… at com.sun.tools.doclets.standard.Standard.… at sun.reflect.NativeMethodAccessorImpl.inv… Method) at sun.reflect.NativeMethodAccessorImpl.inv… at sun.reflect.DelegatingMethodAccessorImpl… at java.lang.reflect.Method.invoke(Method.j… at com.sun.tools.javadoc.DocletInvoker.invo… at com.sun.tools.javadoc.DocletInvoker.star… at com.sun.tools.javadoc.Start.parseAndExec… at com.sun.tools.javadoc.Start.begin(Start.… at com.sun.tools.javadoc.Main.execute(Main.… at com.sun.tools.javadoc.Main.main(Main.jav… com.sun.tools.doclets.internal.toolkit… at com.sun.tools.doclets.internal.toolkit.b… at com.sun.tools.doclets.internal.toolkit.b… at com.sun.tools.doclets.formats.html.HtmlD… at com.sun.tools.doclets.internal.toolkit.A… at com.sun.tools.doclets.internal.toolkit.A… at com.sun.tools.doclets.internal.toolkit.A… at com.sun.tools.doclets.internal.toolkit.A… at com.sun.tools.doclets.formats.html.HtmlD… at com.sun.tools.doclets.standard.Standard.… at sun.reflect.NativeMethodAccessorImpl.inv… Method) at sun.reflect.NativeMethodAccessorImpl.inv… at sun.reflect.DelegatingMethodAccessorImpl… at java.lang.reflect.Method.invoke(Method.j… at com.sun.tools.javadoc.DocletInvoker.invo… at com.sun.tools.javadoc.DocletInvoker.star… at com.sun.tools.javadoc.Start.parseAndExec… at com.sun.tools.javadoc.Start.begin(Start.… at com.sun.tools.javadoc.Main.execute(Main.… at com.sun.tools.javadoc.Main.main(Main.jav… com.sun.tools.doclets.internal.toolkit… at com.sun.tools.doclets.formats.html.HtmlD… 

Creo que detuvo este error cuando comencé a decirle al asistente que colocara los archivos html en una carpeta llamada documentos en mi área de trabajo, por desgracia esta carpeta solo tiene un archivo html vacío con el nombre de una de las clases de mi proyecto ( usualmente Stack.html o Entry.html)

También desafortunadamente eliminé la clase TestClass ya que solo era una prueba, pero aquí está la clase Stack para la que no puedo generar javadoc:

 /** * Provides the Classes necessary to create a Stack data structure. */ package courseworkone; import java.util.ArrayList; /** * Created on 22 Oct, 2012. * * @author James */ public class Stack { /** * The dynamic array into which elements of the Stack are held. */ private ArrayList array; /** * The size of the Stack (The number of elements on the stack). */ private int size; /** * Constructs an empty Stack with an initial size of 0. */ public Stack() { array = new ArrayList(); size = 0; } /** * Checks the number of elements in the stack. * * @return the number of elements in the stack */ public final int size() { return size; } /** * Adds an element to the stack, and increases the stack size by 1. * * @param i * The element to be added to the stack */ public final void push(final Entry i) { // adds the Entry to the stack array.add(i); // increments the stack size by one size++; } /** * Returns the element on the top of the stack. * * @return the top element in the stack */ public final Entry top() { // gets the element at the end of the ArrayList (top element) and // returns it return array.get(size - 1); } /** * Returns the element on the top of the stack and then removes that element * from the stack. * * @return the top element in the stack */ public final Entry pop() { // stores the element at the end of the ArrayList in a temporary // variable Entry mostRecentEntry = array.get(size - 1); // removes the element from the end of the ArrayList array.remove(size - 1); // decrements the size of the stack by one size--; // returns the element at the end of the ArrayList return mostRecentEntry; } } 

También utilicé el asistente javadoc para guardar la configuración de la exportación javadoc como script Ant, y aquí están sus contenidos:

       

Aquí está la salida de la consola de la ejecución de comstackción Ant:

 Apache Ant(TM) version 1.8.3 compiled on February 26 2012 Apache Ant(TM) version 1.8.3 compiled on February 26 2012 Setting ro project property: ant.file -> C:\Users\James\workspace\2ndYearWork\SoftEngCoursework1\javadoc.xml Buildfile: C:\Users\James\workspace\2ndYearWork\SoftEngCoursework1\javadoc.xml Adding reference: ant.projectHelper Adding reference: ant.parsing.context Adding reference: ant.targets parsing buildfile C:\Users\James\workspace\2ndYearWork\SoftEngCoursework1\javadoc.xml with URI = file:/C:/Users/James/workspace/2ndYearWork/SoftEngCoursework1/javadoc.xml Setting ro project property: ant.project.default-target -> javadoc Project base dir set to: C:\Users\James\workspace\2ndYearWork\SoftEngCoursework1 +Target: +Target: javadoc Adding reference: ant.LocalProperties Setting ro project property: ant.project.invoked-targets -> javadoc Adding reference: eclipse.ant.targetVector Build sequence for target(s) `javadoc' is [javadoc] Complete build sequence is [javadoc, ] javadoc: parsing buildfile jar:file:/C:/Users/James/Documents/Eclipse/plugins/org.apache.ant_1.8.3.v20120321-1730/lib/ant.jar!/org/apache/tools/ant/antlib.xml with URI = jar:file:/C:/Users/James/Documents/Eclipse/plugins/org.apache.ant_1.8.3.v20120321-1730/lib/ant.jar!/org/apache/tools/ant/antlib.xml from a zip file [javadoc] scanning C:\Users\James\workspace\2ndYearWork\SoftEngCoursework1\src for packages. dirset: Setup scanner in dir C:\Users\James\workspace\2ndYearWork\SoftEngCoursework1\src with patternSet{ includes: [courseworkone, testcourseworkone] excludes: [] } [javadoc] scanning C:\Users\James\workspace\2ndYearWork\SoftEngCoursework1\test for packages. dirset: Setup scanner in dir C:\Users\James\workspace\2ndYearWork\SoftEngCoursework1\test with patternSet{ includes: [courseworkone, testcourseworkone] excludes: [] } [javadoc] Generating Javadoc [javadoc] Executing 'C:\Program Files (x86)\Java\jdk1.7.0_03\bin\javadoc.exe' with arguments: [javadoc] '-public' [javadoc] '-d' [javadoc] 'C:\Users\James\workspace\docs' [javadoc] '-splitindex' [javadoc] '-use' [javadoc] '-doctitle' [javadoc] 'Stack Implementation' [javadoc] '-classpath' [javadoc] 'C:\Users\James\Documents\Eclipse\plugins\org.hamcrest.core_1.1.0.v20090501071000.jar;C:\Users\James\Documents\Eclipse\plugins\org.junit_4.10.0.v4_10_0_v20120426-0900\junit.jar' [javadoc] '-version' [javadoc] '-author' [javadoc] '-sourcepath' [javadoc] 'C:\Users\James\workspace\2ndYearWork\SoftEngCoursework1\src;C:\Users\James\workspace\2ndYearWork\SoftEngCoursework1\test' [javadoc] '-source' [javadoc] '1.7' [javadoc] 'courseworkone' [javadoc] 'testcourseworkone' [javadoc] [javadoc] The ' characters around the executable and arguments are [javadoc] not part of the command. [javadoc] Javadoc execution Execute:Java13CommandLauncher: Executing 'C:\Program Files (x86)\Java\jdk1.7.0_03\bin\javadoc.exe' with arguments: '-public' '-d' 'C:\Users\James\workspace\docs' '-splitindex' '-use' '-doctitle' 'Stack Implementation' '-classpath' 'C:\Users\James\Documents\Eclipse\plugins\org.hamcrest.core_1.1.0.v20090501071000.jar;C:\Users\James\Documents\Eclipse\plugins\org.junit_4.10.0.v4_10_0_v20120426-0900\junit.jar' '-version' '-author' '-sourcepath' 'C:\Users\James\workspace\2ndYearWork\SoftEngCoursework1\src;C:\Users\James\workspace\2ndYearWork\SoftEngCoursework1\test' '-source' '1.7' 'courseworkone' 'testcourseworkone' The ' characters around the executable and arguments are not part of the command. [javadoc] Loading source files for package courseworkone... [javadoc] Loading source files for package testcourseworkone... [javadoc] Constructing Javadoc information... [javadoc] Standard Doclet version 1.7.0_03 [javadoc] Building tree for all the packages and classes... [javadoc] java.lang.IllegalArgumentException [javadoc] at sun.net.www.ParseUtil.decode(ParseUtil.java:202) [javadoc] at sun.misc.URLClassPath$FileLoader.(URLClassPath.java:1016) [javadoc] at sun.misc.URLClassPath$3.run(URLClassPath.java:357) [javadoc] at sun.misc.URLClassPath$3.run(URLClassPath.java:352) [javadoc] at java.security.AccessController.doPrivileged(Native Method) [javadoc] at sun.misc.URLClassPath.getLoader(URLClassPath.java:351) [javadoc] at sun.misc.URLClassPath.getLoader(URLClassPath.java:328) [javadoc] at sun.misc.URLClassPath.findResource(URLClassPath.java:171) [javadoc] at java.net.URLClassLoader$2.run(URLClassLoader.java:551) [javadoc] at java.net.URLClassLoader$2.run(URLClassLoader.java:549) [javadoc] at java.security.AccessController.doPrivileged(Native Method) [javadoc] at java.net.URLClassLoader.findResource(URLClassLoader.java:548) [javadoc] at java.lang.ClassLoader.getResource(ClassLoader.java:1138) [javadoc] at java.net.URLClassLoader.getResourceAsStream(URLClassLoader.java:227) [javadoc] at javax.xml.parsers.SecuritySupport$4.run(SecuritySupport.java:94) [javadoc] at java.security.AccessController.doPrivileged(Native Method) [javadoc] at javax.xml.parsers.SecuritySupport.getResourceAsStream(SecuritySupport.java:87) [javadoc] at javax.xml.parsers.FactoryFinder.findJarServiceProvider(FactoryFinder.java:248) [javadoc] at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:221) [javadoc] at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:126) [javadoc] at com.sun.tools.doclets.internal.toolkit.builders.LayoutParser.parseXML(LayoutParser.java:88) [javadoc] at com.sun.tools.doclets.internal.toolkit.builders.ClassBuilder.build(ClassBuilder.java:117) [javadoc] at com.sun.tools.doclets.formats.html.HtmlDoclet.generateClassFiles(HtmlDoclet.java:186) [javadoc] at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.generateClassFiles(AbstractDoclet.java:183) [javadoc] at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.startGeneration(AbstractDoclet.java:125) [javadoc] at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.start(AbstractDoclet.java:83) [javadoc] at com.sun.tools.doclets.formats.html.HtmlDoclet.start(HtmlDoclet.java:63) [javadoc] at com.sun.tools.doclets.standard.Standard.start(Standard.java:39) [javadoc] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [javadoc] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [javadoc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [javadoc] at java.lang.reflect.Method.invoke(Method.java:601) [javadoc] at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:280) [javadoc] at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:160) [javadoc] at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:397) [javadoc] at com.sun.tools.javadoc.Start.begin(Start.java:167) [javadoc] at com.sun.tools.javadoc.Main.execute(Main.java:59) [javadoc] at com.sun.tools.javadoc.Main.main(Main.java:49) [javadoc] com.sun.tools.doclets.internal.toolkit.util.DocletAbortException [javadoc] at com.sun.tools.doclets.internal.toolkit.builders.LayoutParser.parseXML(LayoutParser.java:95) [javadoc] at com.sun.tools.doclets.internal.toolkit.builders.ClassBuilder.build(ClassBuilder.java:117) [javadoc] at com.sun.tools.doclets.formats.html.HtmlDoclet.generateClassFiles(HtmlDoclet.java:186) [javadoc] at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.generateClassFiles(AbstractDoclet.java:183) [javadoc] at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.startGeneration(AbstractDoclet.java:125) [javadoc] at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.start(AbstractDoclet.java:83) [javadoc] at com.sun.tools.doclets.formats.html.HtmlDoclet.start(HtmlDoclet.java:63) [javadoc] at com.sun.tools.doclets.standard.Standard.start(Standard.java:39) [javadoc] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [javadoc] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [javadoc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [javadoc] at java.lang.reflect.Method.invoke(Method.java:601) [javadoc] at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:280) [javadoc] at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:160) [javadoc] at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:397) [javadoc] at com.sun.tools.javadoc.Start.begin(Start.java:167) [javadoc] at com.sun.tools.javadoc.Main.execute(Main.java:59) [javadoc] at com.sun.tools.javadoc.Main.main(Main.java:49) [javadoc] com.sun.tools.doclets.internal.toolkit.util.DocletAbortException [javadoc] at com.sun.tools.doclets.formats.html.HtmlDoclet.generateClassFiles(HtmlDoclet.java:190) [javadoc] at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.generateClassFiles(AbstractDoclet.java:183) [javadoc] at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.startGeneration(AbstractDoclet.java:125) [javadoc] at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.start(AbstractDoclet.java:83) [javadoc] at com.sun.tools.doclets.formats.html.HtmlDoclet.start(HtmlDoclet.java:63) [javadoc] at com.sun.tools.doclets.standard.Standard.start(Standard.java:39) [javadoc] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [javadoc] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [javadoc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [javadoc] at java.lang.reflect.Method.invoke(Method.java:601) [javadoc] at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:280) [javadoc] at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:160) [javadoc] at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:397) [javadoc] at com.sun.tools.javadoc.Start.begin(Start.java:167) [javadoc] at com.sun.tools.javadoc.Main.execute(Main.java:59) [javadoc] at com.sun.tools.javadoc.Main.main(Main.java:49) [javadoc] Generating C:\Users\James\workspace\docs\courseworkone\Entry.html... BUILD SUCCESSFUL Total time: 5 seconds 

No tengo idea de por qué no puedo generar javadocs correctamente

¿Algunas ideas?

Revisé tu código / documento y me parece bien. Probé con una versión diferente de JavaDoc. Así que revisé la excepción específica. Encontré esto: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6219854 .

Sugieren eliminar classpath como variable de entorno. Como está utilizando Eclipse, construir y generar javadoc no requiere una configuración adicional fuera del IDE. Verifique sus variables y elimine cualquier configuración innecesaria.

Si está utilizando Eclipse, compruebe si el JRE instalado apunta a JAVA_HOME y nada más. Lo había configurado para señalar JAVA_HOME / jre cuál era el problema.