I got the same error in Visual Studio 2015 with cordova 5.1.1 under Windows 10.
To solve the issue, set this environment variable:
_JAVA_OPTIONS=-Xmx512M
- Right click on start-button and open “System”
- Search for “Advanced system settings” and open it
- Click the button “Environment Variables …”
- In System Variables, click “New…”
- New Variable Name: _JAVA_OPTIONS
- New Variable Value: -Xmx512M
- Click OK
- Restart Visual Studio, so the variable is picked up
This Article point me in the right direction. I did change the instructions a littel bit, so they fits to Windows 10.
Hope it helps someone!