Skip to content

Commit 1c093e3

Browse files
authored
Merge pull request quarkusio#47637 from jerboaa/fix_add_opens_JDKSpecifics
Add Add-Opens for java.base/java.lang (JDKSpecifics)
2 parents 21fb481 + 82b8a53 commit 1c093e3

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

build-parent/pom.xml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,8 +448,11 @@
448448
</systemPropertyVariables>
449449
<!-- limit the amount of memory surefire can use, 1500m should be plenty-->
450450
<!-- set tmpdir as early as possible because surefire sets it too late for JDK16 -->
451-
<!-- the add-opens is here to allow to clear the propertiesCache in com.sun.naming.internal.ResourceManager -->
452-
<argLine>${jacoco.agent.argLine} -Xmx1500m -XX:MaxMetaspaceSize=1500m -Djava.io.tmpdir="${project.build.directory}" ${surefire.argLine.additional} --add-opens java.naming/com.sun.naming.internal=ALL-UNNAMED</argLine>
451+
<!-- the add-opens java.naming/com.sun.naming.internal is here to allow to clear
452+
the propertiesCache in com.sun.naming.internal.ResourceManager -->
453+
<!-- the add-opens java.base/java.lang=ALL-UNNAMED is here for
454+
org.jboss.JDKSpecific.ThreadAccess.clearThreadLocals() -->
455+
<argLine>${jacoco.agent.argLine} -Xmx1500m -XX:MaxMetaspaceSize=1500m -Djava.io.tmpdir="${project.build.directory}" ${surefire.argLine.additional} --add-opens java.naming/com.sun.naming.internal=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED</argLine>
453456
<excludedEnvironmentVariables>MAVEN_OPTS</excludedEnvironmentVariables>
454457
</configuration>
455458
</plugin>

core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/JarResultBuildStep.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,6 +1296,8 @@ private void generateManifest(FileSystem runnerZipFs, final String classPath, Pa
12961296
Files.createDirectories(manifestPath.getParent());
12971297
Attributes attributes = manifest.getMainAttributes();
12981298
attributes.put(Attributes.Name.MANIFEST_VERSION, "1.0");
1299+
// JDK 24+ needs --add-opens=java.base/java.lang=ALL-UNNAMED for org.jboss.JDKSpecific.ThreadAccess.clearThreadLocals()
1300+
attributes.put(new Attributes.Name("Add-Opens"), "java.base/java.lang");
12991301

13001302
for (Map.Entry<String, String> attribute : config.jar().manifest().attributes().entrySet()) {
13011303
attributes.putValue(attribute.getKey(), attribute.getValue());

0 commit comments

Comments
 (0)