Thursday 15 September 2011

BlackBerry - Eclipse Error - Invalid Regex in BlackBerry_App_Descriptor.xml

If you ever see this error from Eclipse whilst doing BlackBerry development,

InvalidRegex: Pattern value '([a-zA-Z_]{1,63}[\s-a-zA-Z_0-9.]{0,63}[;]?)*' is not a valid regular expression


you should of course follow the hint in the error and check that none of your values in your BlackBerry_App_Descriptor.xml will fail the regex.

However, there is a very strange case whereby you will see this error regardless of your values. In fact, creating a new project straight from Eclipse will still show the error.

Turns out this could be caused by having Java JRE 7 installed on your machine. The BlackBerry plugin doesn't support this yet, Eclipse might be trying to use that.

The fix? You simply have to edit the eclipse.ini that will live in the same directory as your eclipse.exe that you use to start the IDE. Closing Eclipse and making a backup of eclipse.ini before you do this would be a good idea.

Find the line "openFile" and immediately after, add the following:

-vm
C:/Program Files/Java/jre6/bin/javaw.exe [or wherever your jre6 directory might be]

Cross your fingers and restart Eclipse.
Rebuild your projects.

Wow I hate programming for BlackBerry. Is it not dead yet? Seriously any platform that needs a site like this (http://isthesigningserverdown.com/) needs to get itself sorted.

6 comments:

  1. No worries. Cost me a few hours today so thought I'd try help others avoid such pain.

    ReplyDelete
  2. Hey I was facing the same problem & this solution worked for me!!! Thank you.
    Namrata Mittal.

    ReplyDelete
  3. Wonderful blog & good post.Its really helpful for me, awaiting for more new post. Keep Blogging!



    Blackberry Developmen

    ReplyDelete
  4. Hello,

    Yes this also work for me.

    analyza technologies

    ReplyDelete
  5. This solution works for me.

    my eclipse.ini was pointing to jdk 1.7. I changed it to 1.6 and it worked.

    Thank you very much.

    Vijay Satlawar

    ReplyDelete