JDK-8266036 : class file for sun.misc.Contended not found
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 11,16,17
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-04-27
  • Updated: 2021-07-15
  • Resolved: 2021-07-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 17 JDK 18
17 b31Fixed 18Fixed
Related Reports
Relates :  
Description
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).
Comments
Changeset: 7fcd5ca0 Author: Jan Lahoda <jlahoda@openjdk.org> Date: 2021-07-07 09:49:53 +0000 URL: https://git.openjdk.java.net/jdk17/commit/7fcd5ca0258b1dc6c34c98ced177ee4dc7945f26
07-07-2021

Solving this issue also solves JDK-8258421, which is a P3, making this bug P3 as well.
11-06-2021