Re: problems with running macros from the command line

Posted by dscho on
URL: http://imagej.273.s1.nabble.com/problems-with-running-macros-from-the-command-line-tp3701388p3701391.html

Hi,

On Wed, 4 Oct 2006, Albert Cardona wrote:

> > I found a trick which makes it work here: set DISPLAY to empty:
> >
> > $ DISPLAY= java -classpath ij.jar ij.ImageJ -batch macros/any.txt
>
>
> I have tried this, and nothing prints in a tty.

I am running Linux, so I have a couple of text consoles. If I run your
macro there, with "DISPLAY=", it prints "Hello" and the numbers from 0 to
9.

> > Having said that, I think it is a bug to try to initialize X11 headlessly.
>
> I don't quite understand what you mean. The java is buggy and shouldn't
> init awt and swing peers when headless?

Java should init AWT (and possibly Swing, even if it is not used in
ImageJ), but it should not try to access the contents of the environment
variable DISPLAY, if it is not set. The latter is the Java bug I meant.
 
Ciao,
Dscho