Wednesday, June 02, 2010

Compc not found...

I was setting up another project today and I ran into an odd issue with compc in my ant tasks. Here is the error that I was getting:

compile:
[compc] java.lang.NoClassDefFoundError: flex2/tools/Compc
[compc] Caused by: java.lang.ClassNotFoundException: flex2.tools.Compc
[compc] at java.net.URLClassLoader$1.run(Unknown Source)
[compc] at java.security.AccessController.doPrivileged(Native Method)
[compc] at java.net.URLClassLoader.findClass(Unknown Source)
[compc] at java.lang.ClassLoader.loadClass(Unknown Source)
[compc] at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
[compc] at java.lang.ClassLoader.loadClass(Unknown Source)
[compc] at java.lang.ClassLoader.loadClassInternal(Unknown Source)
[compc] Could not find the main class: flex2.tools.Compc. Program will exit.
[compc] Exception in thread "main"

BUILD FAILED
D:\xx\xx\xx\build.xml:91: compc task failed.

This was the actual location of my flex_sdk:

C:\Program Files\Adobe\Adobe Flash Builder 4 Plug-in (2)\sdks\3.2.0.3958

Oddly enough, I tried all sorts of different combinations to reproduce this in another location to no avail. After digging through the following posts I moved the sdk to the root of my drive and that seemed to do the trick.

For more reading:
http://bugs.adobe.com/jira/browse/SDK-13003
https://bugs.adobe.com/jira/browse/SDK-13602