found solution:
Windows
quotes around the parameter are needed:
grails "-Dgrails.env=demo" run-app
it works both for OS: windows and linux!
Update:
It seems that only powershell windows need quotes, but linux accepts them too:
grails "-Dgrails.env=demo" run-app
For windows cmd.exe you need to use the operator without quotes:
grails -Dgrails.env=demo run-app
horrible.
source share