# How to add additional elements to classpath when executing gradle tasks

**URL:** <https://discuss.gradle.org/t/how-to-add-additional-elements-to-classpath-when-executing-gradle-tasks/37901>\
**Category:** Help/Discuss\
**Created:** [October 13, 2020, 10:26am UTC](https://discuss.gradle.org/t/how-to-add-additional-elements-to-classpath-when-executing-gradle-tasks/37901 "2020-10-13T10:26:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fohlen](https://avatars.discourse-cdn.com/v4/letter/f/ec9cab/32.png) [@Fohlen](https://discuss.gradle.org/u/Fohlen)\
**Post date:** [October 13, 2020, 10:26am UTC](https://discuss.gradle.org/t/how-to-add-additional-elements-to-classpath-when-executing-gradle-tasks/37901/1 "2020-10-13T10:26:51Z")

</div>

Dear Gradle community.

I have a task that I use to debug a library in Java. I would like to add additional JARs to the Gradle client VM which are necessary to properly do the debugging (in our case this is because we have a IntellIJ plugin that needs these libraries on the executing VM in order to function properly).  
I have tried using the GRADLE\_OPTS environment variables which was not successful.

Pointing to the right documentation / way to do this would be immensely useful.
