Reputation: 31
I am trying to set up the JVM parameters for my Gradle project (which contains many main methods) using IntelliJ Community 2021.2 on a Linux system. Creating an idea64.vmoptions in the user directory does not work for me as the main method is not picking up the VM setting from the file. I also tried to set an environment variable to indicate the .vmoptions file, but it still doesn't work.
The only thing that is working for me is the "Add VM Options" in the Run/Debug Configuration, but I don't want to set the VM options every time I create a new main method. What else can I do to set up the VM options for all run configurations in IntelliJ?
Thank you very much!
Upvotes: 3
Views: 11147
Reputation: 402065
.vmoptions file controls the JVM options for IntelliJ IDEA itself. The code you run from IntelliJ IDEA is executed in a separate JVM and the options for this JVM are specified in the Run configuration VM Options field.
To make all the new configurations inherit some common option (like the heap size), you should edit the template configuration as described in the documentation.
Upvotes: 6