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:

[compc] java.lang.NoClassDefFoundError: flex2/tools/Compc
[compc] Caused by: java.lang.ClassNotFoundException:
[compc] at$ Source)
[compc] at Method)
[compc] at 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: Program will exit.
[compc] Exception in thread "main"

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\

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: