JDK-8350624 : Adding --add-opens=... during AOT cache creation implicitly disables AOT ClassLinking
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 25
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2025-02-25
  • Updated: 2025-04-24
  • Resolved: 2025-04-24
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 25
25Resolved
Related Reports
Duplicate :  
Description
Adding --add-opens=... flag during AOT cache creation implicitly disables AOT ClassLinking.

Steps to reproduce:
> $WS/build/linux-x64/images/jdk/bin/java -XX:AOTMode=record -XX:AOTConfiguration=test.aotconf -version

F="--add-opens java.base/java.io=ALL-UNNAMED"
$WS/build/linux-x64/images/jdk/bin/java $F -XX:+AOTClassLinking -XX:AOTMode=create -XX:AOTConfiguration=test.aotconf -XX:AOTCache=test.aotcache -Xlog:cds,class+path=info:file=test.aotlog

> grep aot-link test.aotlog 
[1.488s][info][cds       ]     instance classes   =   816, aot-linked =     0, inited =     0
[1.488s][info][cds       ]       boot             =   816, aot-linked =     0, inited =     0
[1.488s][info][cds       ]         vm             =   150, aot-linked =     0, inited =     0
[1.488s][info][cds       ]       platform         =     0, aot-linked =     0, inited =     0
[1.488s][info][cds       ]       app              =     0, aot-linked =     0, inited =     0
[1.488s][info][cds       ]       unregistered     =     0, aot-linked =     0, inited =     0
[1.488s][info][cds       ]       (enum)           =    27, aot-linked =     0, inited =     0
[1.488s][info][cds       ]       (hidden)         =    15, aot-linked =     0, inited =     0
[1.488s][info][cds       ]       (old)            =     0, aot-linked =     0, inited =     0