Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

New Contributor
Posts: 3
Registered: ‎05-02-2013
My Device: Developer
Accepted Solution

Phonegap: Cannot run program "C:\Program": CreateProcess error=2

Hi all,


I have been building my app without problems till now, but in this moment, when i try to build it i get this error:


     [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 applicatio
     [exec] I/O Error: Cannot run program "C:\Program": CreateProcess error=2, E
l sistema no puede encontrar el archivo especificado
     [exec] [ERROR]                     RAPC exception occurred

Total time: 27 seconds

 The spanish part of the error reads "The system cannot find the specified file".


I have added %JAVA_HOME% in the environment variable "path".


I have tried editing bbwp.properties to change "Program Files (x86)" to "progra~2" but it fails before.


I updated java a few days ago and i think its a problem with the spaces in the "Program Files (x86)" path, but i don't know where is the file wich contains the path that is causing the problem.

I have tried with -verbose when building, but it doesn't help.


Can you help me?? some solution or tip to fix this???


Thank you very much.

Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Phonegap: Cannot run program "C:\Program": CreateProcess error=2

Have you configured your project.properties file as instructed in this getting started guide?




If feels like the path to the SDK is not formatted correctly, and the command line interface is getting stuck on the space

Follow me on Twitter: @n_adam_stanley
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
New Contributor
Posts: 3
Registered: ‎05-02-2013
My Device: Developer

Re: Phonegap: Cannot run program "C:\Program": CreateProcess error=2

Thank you for your answer.


Yes, I checked this file and everything seems to be ok. I tried changing the path in this file from "Program Files (x86)" to "Progra~2" but I still get the same error. (I have done the same change in the bbwp.properties file too with the same result)


As I said, I have been building and testing my app for weeks without any problem (build, sing, deploy and run on the device). It seems like some system update (I think it could be windows 7 or java updates) have changed something, but i don't know what.


If there is a way to know all the files that are used in the building proccess i can look in all of them changing all the paths till i find the one that is giving the error. (not an alegant solution, but...)



Thank you.

BlackBerry Development Advisor
Posts: 832
Registered: ‎07-15-2008
My Device: Passport
My Carrier: Bell

Re: Phonegap: Cannot run program "C:\Program": CreateProcess error=2

Make sure you've got a 32-bit Java Version 6 installed, not Java 7, and not 64-bit. That may have changed on you if you just did an upgrade.


Also, I believe you should have a JAVA_HOME variable pointing to this Java installation, but you should put %JAVA_HOME%\bin in your path, so that you get the actual java.exe and javac.exe commands.


You can test this by running the command "set path" at a command prompt, to see what path variables are showing up. And you should be able to run "java -version" at the same prompt and get your correct java version output.


I see this for my Java Version when running that command:


C:\Users\twindsor>java -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) Client VM (build 20.45-b01, mixed mode, sharing)


Tim Windsor
Open Source Technical Lead
New Contributor
Posts: 3
Registered: ‎05-02-2013
My Device: Developer

SOLVED: Phonegap: Cannot run program "C:\Program": CreateProcess error=2

Thank you all,


I had Java 7 installed (32 bits), I had a JAVA_HOME variable pointing to the last version installed and I had %JAVA_HOME%\bin in my path, but it failed with all of that.


I have solved it the "easy" way. I downloaded the latest versions of ant, java, and the webworks sdk and reinstalled them in c: in a path without spaces. I changed the value of the JAVA_HOME variable and the paths in the project.properties file pointing to the new ones and everything worked as before.


Hope this can help somebody.


Thank you for your support.