Closed juergenzimmermann closed 1 year ago
Can confirm this happening. Trying to find a way to specify jvmargs for the asciidoctor subprocess, but nothing so far.
Try this approach
asciidoctor {
inProcess = JAVA_EXEC // or "JAVA_EXEC"
forkOptions {
jvmArgs '-Dfoo-base', '-XX:something=more'
}
}
forkOptions
configures a org.ysb33r.grolifant.api.JavaForkOptions
which has a similar interface to org.gradle.process.JavaForkOptions
No idea if this will solve the case, but if it does it give you a workaround until we can get to JDK16 testing.
@ysb33r Looks promising although it doesn't seem to take the --add-opens argument.
Trying:
asciidoctor {
inProcess = JAVA_EXEC
forkOptions {
jvmArgs("--add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED")
}
dependsOn(asciidoctorPdf)
}
with asciidoctorPdf having the same configuration.
I am using some --add-opens on the main gradle process to get kapt
to work, but for some reason the asciidoctor process complains with:
Unrecognized option: --add-opens java.base/sun.nio.ch=ALL-UNNAMED
UPDATE: Got it working with --add-opens
:
jvmArgs("--add-opens","java.base/sun.nio.ch=ALL-UNNAMED","--add-opens","java.base/java.io=ALL-UNNAMED")
The following code fragment works for my build.gradle.kts
file:
inProcess = org.asciidoctor.gradle.base.process.ProcessMode.JAVA_EXEC
forkOptions {
jvmArgs("--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", "--add-opens", "java.base/java.io=ALL-UNNAMED")
}
@alwyn You need to pass a list, not a single concatenated string.
@juergenzimmermann Unless Gradle specifically dopes somethign in future releases, it look likes the plugin might have to add those options automatically if it detects JDK16.
When I invoke
gradle asciidoctor
with Java 16 then I get the outputWARN FilenoUtil : Native subprocess control requires open access to the JDK IO subsystem
.Using
gradle asciidoctor --info
shows the following detail: