Search code examples
javaspring-bootintellij-idea

How to set JAVA_OPTS in Intellij for a Spring Boot project?


I want to add JAVA_OPTS in Intellij for a Spring Boot project and I don't know where to add it. I go to Edit configuration and then should I add it at the Environment variables like here: enter image description here But I don't think that it is ok how I set it because if I set it with this values "JAVA_OPTS=-Xms1m -Xmx1m", the app started properly. And also how can I log the JAVA_OPTS? Thank you in advance!


Solution

  • You just add these to the VM options in your run configuration. Select Modify options > Add VM Options and put in -Xms1m -Xmx1m. Do not add JAVA_OPTS=, just the arguments.