Building Flex on a Headless Server

November 11, 2010

I'm building Flex code from Hudson via ant, and it runs in a headless environment, failing with:

Error: An error occurred because there is no graphics environment available.  
Please set the headless-server setting in the Flex configuration file to true.

This means editing flex-config.xml, which is located in:

C:\Program Files\Adobe\Flex Builder 3\sdks\3.3\frameworks

on windows. In my case I'd copied the SDKs to /apps/sdks on a linux box, so mine were in

/apps/sdks/3.3/frameworks

As a subtag of <compiler>, add

<headless-server>true</headless-server>

This will then fix the problem.

Not sure why the compiler can't autodetect this and cope, but never mind!

Tags: ant hudson flex