[Fixed] An internal build error has occurred

When working in Eclipse/Flash Builder, occasionally something wacky will happen in a project or the workspace itself that causes the following message to appear: "An internal build error has occurred. See the error log for more information." In some cases, a refresh and/or clean of the project in question is enough to straighten things out. But if that were always the case, this would be a very short blog entry, and that's not really my style.

I recently encountered the "internal build error" monster when working with a Flex module I hadn't touched in months. I simply opened it up and tried to build it, and I was instantly on my way to bang-my-head-against-my-desk-in-frustration territory. Nothing about the project had changed, so all signs pointed to something in the development environment. But what?

Step one was to figure out how to "See the error log for more information." There is no apparent indication of where to find this mythical error log, and my best guess (C:\Program Files\Adobe\Flash Builder...?) was a no-go. Luckily I stumbled across an entry over at the 9MMedia Blog which pointed me to the folder {workspace}\.metadata - ah, yes, I recall now that Eclipse loves organizing everything under a workspace. Fair enough.

Upon finding the log, I was greeted by a particularly inscrutable error message:

!MESSAGE Uncaught exception in compiler
!STACK 0
java.lang.IllegalArgumentException: Comparison method violates its general contract!
{lengthy stack trace}

Gee, I didn't mean to violate anyone's contract.

From here, it was back to Google to find this thread on an Adobe forum. It seems there is an issue with backward compatibility in JDK 7. The proposed solution was to add a line to the -vmargs section of the flashbuilder.ini file (this one is, for us Windows folks, found under C:\Program Files\Adobe\Flash Builder)...

-Djava.util.Arrays.useLegacyMergeSort=true

Restart Eclipse/Flash Builder, and voila! No more "internal build error" nonsense, which allows us developers to address all kinds of other nonsense.

Happy coding!

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Jay Wood's Gravatar Josh, I've been getting this error several times a day ever since upgrading from 4.6 to 4.7 on Windows Vista. I applied your fix to the .ini file this morning, and it seems to have done the trick. Thanks for sharing!
# Posted By Jay Wood | 11/7/13 8:16 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.9.002. Contact Blog Owner