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

Adobe AIR Development

New Member
Posts: 1
Registered: ‎10-27-2010
My Device: Not Specified
Accepted Solution

Blackberry-packager CLI issues "Exception in thread main"...

Hey guys, I was having trouble building from FB4, so I figured I would test out the CLI to get running. Unfortunately I've run into some problems. I'm running a MacBookPro, os x 10.5.8.


I did a software update, thinking i needed to update Java, and installed the latest version from Apple's 'Software Update'. I ran java -version, here's what I got:



Java version "1.5.0_26"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_26-b03-376-9M3263)
Java HotSpot(TM) Client VM (build 1.5.0_26-156, mixed mode, sharing)


When running 'blackberry-airpackager' from terminal I'm getting the following error




Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:676)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:317)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:280)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:375)


Any help would be greatly appreciated! Thanks.


Posts: 35
Registered: ‎10-25-2010
My Device: Not Specified

Re: Blackberry-packager CLI issues "Exception in thread main"...

You need to run Java 1.6. Some classes in the SDK require 1.6 JVM.


Posts: 12
Registered: ‎11-04-2010
My Device: Storm 9500
My Carrier: Vodaphone

Re: Blackberry-packager CLI issues "Exception in thread main"...

I've got the same issue on MacBook Pro 2,1 running Leopard 1.5.8 update 8


BB SDK in Flash Builder works fine with fresh install of 10.5.8 u8 but will not debug actionscript project.


Change the java version to 1.6 with Flash Builder still open and I can debug my project, but when Flash Builder is restarted Eclipse fails to open:


JVM terminated.

Exit code=-1


Surely I can't be expected to keep switch Java runtimes to open my developer environment then have to switch to compile? There must be something I've missed but I've re-installed everything including Flash Builder twice now with the same issue.

BlackBerry Development Advisor
Posts: 417
Registered: ‎10-27-2010
My Device: PlayBook

Re: Blackberry-packager CLI issues "Exception in thread main"...

Flash Builder is probably requires 32 bit mode and your default java is 64 bit? You can modify startup of FlashBuilder to pass -d32 flag to java (-vmargs -d32) or whatever mac java supports