Friday, April 05, 2013

Gotch of the Day: fcsh fails to execute

It's been years, but I'm still using fcsh to compile my ActionScript related apps, be they Flex or AIR based. And usually, fcsh just works. Except for recently, it has stopped executing properly.

At first I thought it must be some sort of emacs glitch, where I usually run fcsh. But, opening up a generic cmd.exe gave me the following error:

C:\Users\ben>fcsh
Error loading: c:\tools\java\jre7\bin\server\jvm.dll

I checked the usual suspects:

  • The DLL above exists and I have permission to read it
  • My JAVA_HOME variable is set properly
  • I tried setting my JAVA_HOME variable to both the JDK and JRE I have installed on my computer

Finally I fired up ProcMon to try to get a sense of what fcsh.exe was actually doing. I noticed that it was accessing a jvm.config file in the same directory as the fcsh.exe binary. That got me thinking: what if my own JAVA_HOME setting was somehow conflicting with something in there.

I went ahead and unset JAVA_HOME in my system environment. To my shock, fcsh.exe went back to working.

I think that's the first time in my life where having a sane value for JAVA_HOME was actually causing problems, not fixing them.

By the way, I did some checking: my hypothesis about jvm.config conflicting with JAVA_HOME is totally false. I can move that file out of the way, and as long as I've got JAVA_HOME set, the fcsh doesn't work. While the hypothesis was wrong, it was indeed enough to get me to the right answer (or to a work around). I'll take it!

No comments:

Post a Comment