Unable to Compile Java 10/11 Project with Maven
A common issue encountered when attempting to compile Java 10 or 11 projects with Maven is a failure with the error message "java.lang.IllegalArgumentException". This error occurs due to limitations in the Maven compiler plugin.
Fix
To resolve this issue, the following steps can be taken:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.0</version> </plugin>
<configuration> <release>11</release> </configuration>
Note: The default source/target levels have been updated to 1.6 with the new plugin version.
Extended Support for JDK 12
The same maven-compiler-plugin version 3.8.0 can also be used to compile code against JDK 12. Refer to the Maven documentation for details on compiling and executing Java preview features with Maven.
The above is the detailed content of Why Does My Maven Build Fail with \'java.lang.IllegalArgumentException\' When Compiling Java 10/11?. For more information, please follow other related articles on the PHP Chinese website!