Can't get debugger and compiler working at the same time


(Eric Dand) #1

I first noticed the debugger wasn’t working when I tried to set a breakpoint and FlashDevelop didn’t break on it. I poked through the project settings and found that it was using C:\Users\Eric\AppData\Local\FlashDevelop\Apps\flashsa\14.0.0\flashplayer_14_sa_debug.exe to debug.

(From here on out, all paths are relative to C:\Users\Eric\AppData\Local\FlashDevelop\Apps unless otherwise marked.)

So I changed it to use FlashPlayerDebugger.exe. from flexsdk\4.6.0\runtimes\player\11.1\win. It still didn’t work. So I checked online for some more help, found out that FlashDevelop uses the fdb program from flexsdk\4.6.0\bin as a debugger. I tried launching fdb directly from the command line, and it said it had an error loading jvm.dll from my JAVA_HOME.

I have Java 8 installed, and I read online that Flex wants a 32-bit Java 6, so I installed that and edited jvm.config (found in the same directory as fdb). I changed the line

java.home=

to say

java.home=C:\Program Files (x86)\Java\jdk1.6.0_45\

But then it said “Error: could not find a JVM.” I did some more digging, and found that others were using forward-slashes instead, so I then tried changing it to

java.home=C:/Program Files(x86)/Java/jdk1.6.0_45/

but this gave me the same ambiguous “Error loading” message from before. I think the forward-slashes messed it up, but it was worth a try.

I then downloaded the latest Flex SDK and installed it overtop of the existing one, despite the version numbers seeming to be identical. Suddenly, fdb worked, without even changing java.home in jvm.config! However, FlashDevelop couldn’t compile my code. So, I re-set that variable in jvm.config to point to C:\Program Files (x86)\Java\jdk1.6.0_45 this time, and then FD could compile again.

As soon as I had compiled, though, fdb went back to saying “Error: could not find a JVM.” FlashPunk still didn’t break at my points, either. I noticed that the play/pause/stop icons at the top of FlashDevelop would suggest that the debugger is still going, even after I closed the Flash player running my game. Here is a little screenshot to show their state: http://i.imgur.com/YXP7cpD.png

At this point I’m stumped. Here are the facts as well as I can tell:

  • fdb works fine with Java 8.
  • FlashDevelop needs Java 6 to compile ActionScript 3.0.
  • Both programs use the same jvm.config file to find a JVM. It seems that I can either compile in FD, or debug from the command-line, but I can’t do both at the same time, and I can’t attach a debugger to FD.

Is there a way to set separate Java versions for different parts of FlashDevelop?


(Mike Evmm) #2

It sounds like your PATH might not be set to include java.


(Eric Dand) #3

My path does include Java. It does point to Java 8, though. When I try to build and run, I get the following message in the Output tab:

mxmlc -load-config+=obj\GameConfig.xml -debug=true -incremental=true -swf-version=14 -o obj\Game635577173532510858
Starting java as: C:\Program Files\Java\jdk1.8.0_20\bin\java.exe -Xmx384m -Dsun.io.useCanonCaches=false -Duser.language=en -Duser.region=US -Dapplication.home="C:\Users\Eric\AppData\Local\FlashDevelop\Apps\flexsdk\4.6.0" -Dflexlib="C:\Users\Eric\AppData\Local\FlashDevelop\Apps\flexsdk\4.6.0\frameworks" -jar "C:\Users\Eric\AppData\Local\FlashDevelop\Apps\flexsdk\4.6.0\lib\fcsh.jar"
Unable to start java.exe: The system cannot find the file specified
Could not compile because the fcsh process could not be started.
Build halted with errors (fcsh).
INITIALIZING: Failed, unable to run compiler
Done(1)

So it tries to run, but then it can’t run fcsh, I assume because it’s Java 8. Setting the Java version in jvm.config does force it to run Java 6 and compile properly. As I ran it again to get some more output for you, this time, fdb did run and attach properly! I’m not sure what I did.

Regardless, unless this happens again, I’m going to call it a weird FlashDevelop bug, and remember that Flex needs Java 6.


(Martí Angelats i Ribera) #4

It’s saying that the route “C:\Program Files\Java\jdk1.8.0_20\bin\java.exe” don’t exist. Go there and be sure there is the java.exe.

Ether way, I recomend you to download and install the lastest version of Java JDK and change the path to it.


(Mike Evmm) #5

FD tends to freak out like that occasionally. Glad you solved your problem!