2019-07-09

How to add parameters to the app when running or debugging a gradle project in Netbeans 11.0

In classic projects in Netbeans you can add some parameters to the execution of the java app, but how to do it with Gradle projects?

After googling it for a while, and tons of tries, I've found how to solve the problem. go to gradle.properties, you will found the following line

action.debug.args=run --debug-jvm

just add --args foo or --args=foo or even --args="foo" to that line, so you'll get

action.debug.args=run --debug-jvm --args foo

if you want to add more than one parameter, for example foo bar then you'll get

action.debug.args=run --debug-jvm --args "foo bar"

quotes are mandatory or you'll get only the first parameter.

Easy, doesn't it?

That's all folks!!! :-)

Happy hacking!!!