Login  Register

Re: Using System.out and System.err from ImageJ plugins (Java)

Posted by dscho on Feb 27, 2013; 9:29pm
URL: http://imagej.273.s1.nabble.com/Using-System-out-and-System-err-from-ImageJ-plugins-Java-tp5001799p5001906.html

Dear Wayne,

On Wed, 27 Feb 2013, Johannes Schindelin wrote:

> [...] causing an infinite loop. You can easily reproduce that issue with
> this command-line:
>
> java -jar ij.jar -eval \
> 'setOption("debugmode", 1); eval("script", "importClass(Packages.java.lang.System); System.err.println(\"Hello\");");' \
> -batch

An easier command-line that also demonstrates that this is not some looney
idea of mine but a real-world scenario:

        java -jar ij.jar -eval \
                'setOption("debugmode", 1); print("Hello, Wayne");' -batch

I also failed to mention that this just exits without an error message
(but exit code 1) because the exception that is thrown when stack space is
up is swallowed by the fact that Macro_Runner#runMacro(String, String)
cannot print to stderr due to the very infinte loop.

Ciao,
Johannes

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html