Java 8 javadoc tool features and bug with gradle: how to get around this?

I have a very strange error with gradle (1.11) and javadoc task. I have links in mine build.gradle, for example:

javadoc.options.links("http://docs.oracle.com/javase/7/docs/api");

Now I am using Java 8 (JDK downloaded from Oracle) and here is the result of the javadoc task:

fge@alustriel:~/src/perso/largetext$ java -version; ./gradlew clean javadoc
java version "1.8.0"
Java(TM) SE Runtime Environment (build 1.8.0-b132)
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode)
:clean
:compileJava
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
:processResources
:classes
:javadoc
javadoc: warning - Error fetching URL: http://docs.oracle.com/javase/7/docs/api
javadoc: warning - Error fetching URL: http://jsr-305.googlecode.com/svn/trunk/javadoc
javadoc: warning - Error fetching URL: http://docs.guava-libraries.googlecode.com/git-history/v16.0.1/javadoc
3 warnings

BUILD SUCCESSFUL

Total time: 7.726 secs

And indeed, when I look at javadoc, all external links are missing; if I run with Java 7, however:

fge@alustriel:~/src/perso/largetext$ (export JAVA_HOME=/opt/sunjdk/1.7/current; export PATH=$JAVA_HOME/bin:$PATH; java -version; ./gradlew clean javadoc)
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
:clean
:compileJava
:processResources
:classes
:javadoc

BUILD SUCCESSFUL

Total time: 7.635 secs

then everything works.

Now I also tried and modified the javadoc read link:

// Note the appended "/package-list"
javadoc.options.links("http://docs.oracle.com/javase/7/docs/api/package-list");

Using Java 8, it does not give any warnings, generates links ... But links do not work! That is, for example, I get:

http://docs.oracle.com/javase/7/docs/api/package-list/java/lang/NullPointerException.html?is-external=true

(note package-list/) as a link instead:

http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true

What has changed in Java 8, what causes this? Is there a workaround?

+4

Source: https://habr.com/ru/post/1534209/


All Articles