Skip to content
Advertisement

How do I set JVM options for GradleWorkerMain?

When I set GRADLE_OPTS or JAVA_OPTS, these are set for GradleWrapperMain when I run ./gradlew build for my project. But I need them to be set for GradleWorkerMain as well.

How do I do that?

Here’s the ps listing when that Gradle job is running in Bamboo. My JAVA_OPTS (such as -Dcool.opt=1) is missing from GradleWorkerMain.

JavaScript

Advertisement

Answer

There is no direct way to set JVM options for a GradleWorkerMain process. Most (but not all) task types that fork new workers implement JavaForkOptions, so you could try:

JavaScript

Task types that don’t implement JavaForkOptions typically allow to set fork options in some other way. For example:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement