javadoc cross-compilation problem

Gilles Duboscq duboscq at
Mon Apr 7 09:55:10 UTC 2014


When using jdk8 to generate javadoc for a 7 source base (some
paths/arguments replaced by ...):

javadoc -J-Xmx2g -XDignore.symbol.file -classpath ... -quiet -d ...
-overview .../overview.html -sourcepath ... -source 1.7 -bootclasspath
-extdirs /usr/java/jdk1.7.0_51/jre/lib/ext -tag test:X -tag run:X -tag
bug:X -tag summary:X -tag vmoption:X -XDignore.symbol.file
-windowtitle '...' ...

I get the following error:

javadoc: error -$CompletionFailure: class file for
java.lang.FunctionalInterface not found

The same sources compile fine on jdk7 and also generate javadoc fine
on jdk7. They also compile fine on jdk8 when setting -source 1.7,
-bootclasspath and -extdirs.

I think the error is caused by the implementation of
RootDocImpl.isFunctionalInterface which calls toString on
env.syms.functionalInterfaceType which in turn calls
ClassType.getTypeArguments which calls complete().

I tried to fix this by checking for env.source.allowLambda() before
doing the String comparison [1] and this fixed my problem. I tried
running javadoc on some other 8 and 7 source bases and didn't see any
problem with this patch.



More information about the javadoc-dev mailing list