Cannot run program “C:\Program”: CreateProcess error
When building a Webworks / Phonegap app for BlackBerry, I got the following error message from ANT:
[exec] [INFO] Parsing command line options
[exec] [INFO] Parsing bbwp.properties
[exec] [INFO] Validating application archive
[exec] [INFO] Parsing config.xml
[exec] [INFO] Populating application source
[exec] [INFO] Compiling BlackBerry WebWorks application
[exec] I/O Error: Cannot run program “C:\Program”: CreateProcess error=2, The system cannot find the file specified
[exec] [ERROR] RAPC exception occurred
This happened just after updating Java on my computer, so I assumed that it was something to do with Java, and that it was cutting off “Program Files” to “Program”.
After hunting around for the reference to Java that ANT uses, I spotted the file C:\BBWP\bin\bbwp.properties, which containted the following XML:
<?xml version=”1.0″ encoding=”UTF-8″?>
So, using the old DOS hack, I changed Program files to “Progra~1”
And re-ran ANT BUILD, and it worked!