Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javadoc in JDK 8 : Invalid "self-closing element not allowed"

What are the best workarounds when running javadoc using JDK 8 and one receives this error.

It seems that for JDK 8 it has been decided that tags like <br /> and <p /> should generate errors, because they are invalid (strict) HTML 4. see discussion JDK mailing list here

I wonder, because I just wanted to compile some java project using maven and tripped over this issue. Of course, I can file a ticket with the project (and I guess I will), but it would be great if there is a way how to disable this behaviour (for a machine). Otherwise, I expect that a lot of projects need to be fixed before they can be built on JDK 8 without issues.

like image 654
JE42 Avatar asked Sep 25 '14 22:09

JE42


2 Answers

For those two particular cases, I think the recommended action is to substitute them with <p>. This is the link to the Oracle documentation.

like image 187
Tavo Avatar answered Nov 15 '22 15:11

Tavo


To remove the errors in the javaDocs just replace:

  • <p/> with just <p>
  • <br/> with just <br>

Everything works fine after the correction in a excepted way.

like image 21
Xelian Avatar answered Nov 15 '22 15:11

Xelian