Reputation: 519
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
Upvotes: 16
Views: 37581
Reputation: 64
You can use the GRADLE_OPTS environment variable. Here is the documentation
Upvotes: 4
Reputation: 2400
Try this:
./gradlew -Dorg.gradle.jvmargs=-Xmx16g wrapper
-D
, this marks the property to be passed to Gradle and JVM.-P
a property is passed as Gradle project property.Upvotes: 19
Reputation: 908
Hi for Intellij IDEA run you can add property to JM Options at Run Configuration.
First make sure you have enabled add VM options at Modify Options
After that add --add-opens java.base/java.util=ALL-UNNAMED to vm option
For deployment add options to gradle run as @ultraon described or for Docker add to run_script.sh as JAVA_OPTS
JAVA_OPTS="-XX:+UseG1GC
-Xms512m
-Xmx2048m
--add-opens java.base/java.util=ALL-UNNAMED
-Dspring.profiles.active=$PROFILE,discovery"
Upvotes: 0