I`ve changed jdk to a 9 version in my project and then collided with an error :
Error:java: java.lang.NoClassDefFoundError: javax/annotation/Generated
I try to solve it by the adding following to pom.com but it wasn`t work for me:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${version.compiler.plugin}</version>
<configuration>
<!-- fork is needed so compiler args can be used -->
<fork>true</fork>
<compilerArgs>
<arg>-J--add-modules</arg>
<arg>-Jjava.annotations.common</arg>
</compilerArgs>
</configuration>
</plugin>
Does it have other way to solve?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…