Affected version
3.14.0, 3.14.1
Bug description
There are import sun.misc.Unsafe; in our codes, we want the target class bytecode version is java 8 for the sake of compatibility.
During runing mvn compile with jdk17+,
- we will encounter
Cannot compile: java: package sun.misc does not exist ERROR and the compilation process will be terminated with failure if we set maven.compiler.release to 8
<properties>
<maven.compiler.release>8</maven.compiler.release>
</properties>
or configure release of maven-compiler-plugin to 8 at the pom.xml like this,
<profile>
<id>jdk9-compile</id>
<activation>
<jdk>[1.9,)</jdk>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<release>8</release>
</configuration>
</plugin>
</plugins>
</build>
</profile>
Unsafe is internal proprietary API and may be removed in a future release Warning will appear and the compilation process will continue if we set maven.compiler.target to 1.8 at the pom.xml (delete jdk9-compile profile configuration) like this,
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>