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

JE42 picture JE42 · Sep 26, 2014 · Viewed 19.8k times · Source

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.

Answer

Tavo picture Tavo · Feb 18, 2015

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