G’day
Early this year I first encountered this issue when trying to execute integration tests within IntelliJ.
Error occurred during initialization of VM
java.lang.InternalError: Could not create SecurityManager: jarjar.org.gradle.process.internal.child.BootstrapSecurityManager
The problem has been intermittent and difficult to reproduce, but I think I’ve finally got to the bottom of it. The fundamental issue is that the gradle-worker.jar, which is generated by JarJar at Gradle runtime, is generated incorrectly. It seems like the JarJar task will silently fail to do it’s job if there are duplicate files to be included in the jar. The fact that this jar file is generated at runtime made diagnosis a little more tricky.
The files that triggered this issue were duplicate package-info.java files: certain packages we present in multiple subprojects in the Gradle build, with a `package-info` file in both. This triggered a Javadoc warning, but caused no problem with CLI gradle. However, running from inside IntelliJ caused the gradle-worker.jar to be generated incorrectly (if it hadn’t already been generated by a CLI invocation).
I recently cleaned up the duplicate package-info.java files to remove the Javadoc warnings. I did this by adding checkstyle exceptions to suppressions.xml, and removing the duplicate files. In doing so, I seem to have resolved the BootstrapSecurityManager issue.
Steps to reproduce the issue: