Search code examples
javaintellij-ideagradle

How can I pass VM arguments to gradle from command line?


How can I pass VM arguments to gradle from command line. The Gradle Tool option in Idea is working fine ( screehshot attached). I am trying to pass --add-opens to gradle and am aware of -P but it is not working.

The GRADLE VM options from the Idea


Solution

  • You can use the GRADLE_OPTS environment variable. Here is the documentation