I was playing around with new Java 16 features and when I wanted to build a local maven install I get this error:
Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.2.0:jar (attach-javadocs) on project persism: MavenReportException: Error while generating Javadoc:
error: ')' expected
if (object instanceof Persistable<?> pojo) {
Pointing to "pojo" variable. This works fine when I run and build in the IDE. I have other Java 16 features in the code like records as well.
My POM source and target are set to 16.
I notice it runs this:
exe /X /C "C:\Java\jdk1.8.0_231\bin\javadoc.exe @options @argfile"
why is it running Java 8?
Any ideas?
Yeah I realized that Maven ran java 8 for the Javadoc. I set JAVA_HOME to my java 16 version. Problem solved.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.