Normally vm options stored in idea.vmoptions and idea64.vmoptions contain no spaces. But whenever you need to set an option which contains one, the idea.sh will fail.
A common use-case for a vm option containing a space is the following line:
This will override the user name used in all templates with the given one. To get IDEA working with such a setting you have to edit file idea.sh.
At the very end of the script there is the following block: