Fail to build Javadoc with java 17 in Eclipse

Eclipse is doing what you asked it to do.

javac17 can still be configured to compile java 8 code. Just like, say, ‘Word 2024’ can still open files made with ‘word 2016’.

And.. it is. That’s what the -source 8 is about: You’re running javadoc -source 8 .....

Click on ‘next’ twice. You will see the option ‘JRE source compatibility’. Set that to at least 15; it is currently on 8, so eclipse is dutifully telling javac to parse it as if its java 8 compatible source, and expression-switches aren’t compatible with that.

Read more here: Source link