Search code examples
actionscript-3flashdebuggingairflashdevelop

Flash Develop Debbuger - System.BadImageFormatException


Since I've updated my Flash Develop and installed the latest versions of Air/Flex SDK I can no longer debug application because of the following error:

Debugger startup error. For troubleshooting see: http://www.flashdevelop.org/wikidocs/index.php?title=F.A.Q
Error details: System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
   em net.sf.jni4net.jni.JNI.Dll.JNI_GetDefaultJavaVMInitArgs(JavaVMInitArgs* args)
   em net.sf.jni4net.jni.JNI.Init()
   em net.sf.jni4net.jni.JNI.CreateJavaVM(JavaVM& jvm, JNIEnv& env, Boolean attachIfExists, String[] options)
   em net.sf.jni4net.Bridge.CreateJVM()
   em net.sf.jni4net.Bridge.CreateJVM(BridgeSetup setup)
   em FlashDebugger.DebuggerManager.Start(Boolean alwaysStart)
[Capturing traces with FDB]
...

I'm using Windows 7 x64, FlashDevelop v4.6.4, JDK v1.7, AIR SDK v14.


Solution

  • Solved it by changing jvm.config, you can find it here:

    %USERPROFILE%\AppData\Local\FlashDevelop\Apps\flexairsdk\4.6.0+14.0.0
    

    I modified the parameter java.home (line ~27) to:

    java.home=C:\Program Files (x86)\Java\jre7
    

    Note:
    You can find the path to your SKD folder in your SetupSDK.bat file, FLEX_SDK=...

    Very important:
    Even if you're on a 64bit system, the java.home must point to the 32bit java installation!