zrlw opened a new issue, #990:
URL: https://github.com/apache/maven-compiler-plugin/issues/990
### Affected version
3.14.0
### 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+,
1. 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 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>
```
2. ```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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]