Trying to compile a class that subclasses java.util.concurrent.ForkJoinPool with --release 8 causes the following error:
> javac --release 8 -processorpath demo demo/MyPool.java
error: cannot access Contended
class file for sun.misc.Contended not found
1 error
I can confirm this happens with javac from JDK 11.0.10 and JDK 16.
This can be reproduce with the attached demo.jar:
jar xf demo.jar
javac --release 8 -processorpath demo demo/MyPool.java
As a side note, discovering which Java sources triggered this error was not straight forward as the error message does not mention it (note lack of "MyPool" in the error message).