Consider the following dialog with the command-line interface to the kernel:
$ math
Mathematica 6.0 for Linux x86 (32-bit)
In[1]:= p = Plot[x^2, {x,-1,1}]
Out[1]= -Graphics-
In[2]:= Export["foo.png", p]
Out[2]= foo.png
That works fine on a machine with $Version = 6.0 for Linux x86 (32-bit) (June 2, 2008)
but fails on a machine with $Version = 7.0 for Linux x86 (64-bit) (November 11, 2008)
with the following error:
Export::nofe: A front end is not available; export of PNG
requires a front end.
With similar errors for any other image format I can think of.
So the question is, how can I get the Mathematica kernel, sans front end, to export images? Why does it work without a hitch in Mathematica 6.0? If the above example works for you in version 7, please let me know!
PS: Version 7 introduced the function UsingFrontEnd
but that fails with
Developer`UseFrontEnd::nofestart:
Unable to launch a front end. Proceeding without a front end.
presumably because X11 is not installed on the machine.
Addendum
It turns out there is no difference between version 6 and version 7 in this regard. Rather, on the machine with version 6, the front end was being invoked silently. The problem with the other machine, as the answers to this question make clear, is that there was no X server and so the front end could not be invoked.