I am trying to use javadoc to document a single java file in window 7, to simplify it, I use only the following command:
javadoc Attr.java
However, javadoc gives me an IllegalArgumentException without a detailed description of where this is wrong, in fact the file I am using is copied from Java programming. So I'm wondering what is required to use the javadoc command in the environement window.
It seems like it works first ...
Loading source file Attr.java...
Constructing Javadoc information...
Standard Doclet version 1.6.0_20
Building tree for all the packages and classes...
Generating Attr.html...
But then it starts to produce such errors:
java.lang.IllegalArgumentException
at sun.net.www.ParseUtil.decode(ParseUtil.java:189)
at sun.misc.URLClassPath$FileLoader.<init>(URLClassPath.java:958)
at sun.misc.URLClassPath$3.run(URLClassPath.java:328)
at java.security.AccessController.doPrivileged(Native Method)
at sun.misc.URLClassPath.getLoader(URLClassPath.java:322)
at sun.misc.URLClassPath.getLoader(URLClassPath.java:299)
at sun.misc.URLClassPath.findResource(URLClassPath.java:145)
at java.net.URLClassLoader$2.run(URLClassLoader.java:385)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findResource(URLClassLoader.java:382)
at java.lang.ClassLoader.getResource(ClassLoader.java:1003)
at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:1193)
at javax.xml.parsers.SecuritySupport$4.run(SecuritySupport.java:96)
at java.security.AccessController.doPrivileged(Native Method)
at javax.xml.parsers.SecuritySupport.getResourceAsStream(SecuritySupport.java:89)
at javax.xml.parsers.FactoryFinder.findJarServiceProvider(FactoryFinder.java:250)
at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:223)
at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:128)
Here is the java test file I used:
public class Attr {
private final String name;
private Object value = null;
public Attr(String name) {
this.name = name;
}
public Attr(String name, Object value) {
this.name = name;
this.value = value;
}
public String getName() {
return name;
}
public Object getValue() {
return value;
}
public Object setValue(Object newValue) {
Object oldVal = value;
value = newValue;
return oldVal;
}
public String toString() {
return name + "='" + value + "'";
}
}
/ =====
DECISIONS - thanks to Michael Borgwardt
========= /
first problem:
set CLASSPATH=.
then
javadoc Attr.java