Why Gradle Task "Run" passes command line arguments isn't comprehensible

I’ve tested a few recommendations from the internet to check but nothing seems to explain why the arguments are passed to the main method of the main class.

My checks included:

  • Run/Debug Configuration
  • Args assignment in run-Task
  • Args assignment in execution-Task (type: JavaExec)
  • IntelliJ settings

The arguments which are passed to main are:

  • “mainClassName” → Assigned in application-task
  • JVM-Arguments [“-Xms256m”, “-Xmx1g”, “-Dfile.encoding…”, “-Duser.country=…”, “-Duser.language…”, +3 more] → [“-Xms256m”, “-Xmx1g”]: These values are also assigned in application-task. So if I change these values, the arguments in main are also changed.

Has somebody any idea where these arguments could come from if I start the run task? Thx in advance.

Maybe start with executing the task from the command line to take IntelliJ out of the equation.
If it still happens, you know it is something in your build script or the plugins you use.

Other than that, it is hard to guess without information about your build.
Maybe try to reduce your project to an MCVE.
Most likely at some point the behavior goes away and you have the culprit.

Thank you for your reply . I’ll try your suggestions and keep you informed about the result.

1 Like