# execOperations.javaExec { .. } - modify jvmArgs

**URL:** <https://discuss.gradle.org/t/execoperations-javaexec-modify-jvmargs/52111>\
**Category:** Help/Discuss\
**Created:** [June 29, 2026, 1:49pm UTC](https://discuss.gradle.org/t/execoperations-javaexec-modify-jvmargs/52111 "2026-06-29T13:49:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tkrah](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/tkrah/32/11919_2.png) [@tkrah](https://discuss.gradle.org/u/tkrah)\
**Post date:** [June 29, 2026, 1:49pm UTC](https://discuss.gradle.org/t/execoperations-javaexec-modify-jvmargs/52111/1 "2026-06-29T13:49:25Z")

</div>

Hi,

is it possible to modify `execOperations.javaExec { .. }` to always have a set of `jvmArgs` applied?

I got a plugin (not one of mine) which has a Task and in the body of that task it uses:

`execOperations.javaExec { .. }`

Unfortunately the plugins task has no Provider / Property where I could set my `jvmArgs` to be used in that operation, so the question is, without changing the plugins code - can I somehow modify the `jvmArgs` of `execOperations.javaExec { .. } `globally and/or for that usage in that task?

---

<div class="post-metadata">

**Author:** ![Vampire](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/vampire/32/9082_2.png) [@Vampire](https://discuss.gradle.org/u/Vampire)\
**Post date:** [June 29, 2026, 1:57pm UTC](https://discuss.gradle.org/t/execoperations-javaexec-modify-jvmargs/52111/2 "2026-06-29T13:57:09Z")

</div>

No, that is a task implementation detail.  
If the task author does not provide a way to configure it, there is no way to configure it.

Well, there is `JAVA_TOOL_OPTIONS` environment variable that you can set and that will be picked automatically by any started JVM. But that will then be effective for each and every JVM started while that environment variable is set.

---

<div class="post-metadata">

**Author:** ![tkrah](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/tkrah/32/11919_2.png) [@tkrah](https://discuss.gradle.org/u/tkrah)\
**Post date:** [June 29, 2026, 2:00pm UTC](https://discuss.gradle.org/t/execoperations-javaexec-modify-jvmargs/52111/3 "2026-06-29T14:00:50Z")

</div>

> [@Vampire](#):
>
> `JAVA_TOOL_OPTIONS`

That’s actually a nice idea though, for my usecase this should do the trick.
