User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/22.0.50 (gnu/linux)
Matt Drance <email@hidden> writes:
> Hi Benjamin,
>
> simpleJavaLauncher does that in case your Java code needs to initialize the
> AWT (and therefore Cocoa). If your Java code later initializes AWT (which
> will initialize an NSApplication), it will pick up the existing runloop on the
> main thread. Starting a runloop is not integral to the process working
> correctly if your Java code is headless. If this is a headless app that will
> not initialize the AWT, do what you will in your native main(). However, if
> you will use AWT at any point, you will want to "park in the runloop" as
> simpleJavaLauncher says. If you are stuck in a loop of your own (doing some
> kind of I/O polling for example) when Java tries to load a Frame, you will
> block Cocoa (and therefore AWT) from initializing and not get very far.
Thank you for the explanation. For some applications, I use a startup
property of -Djava.awt.headless=true (because I sometimes am forced to
use java.awt.BufferedImage objects etc. for image processing (JAI),
but no valid X11 DISPLAY is set) but I never actually use any GUI
objects; thus I am headless. For other applications, I never even use
any awt objects at all. So it sounds like I should be OK avoiding
parking in the runloop.
--
Benjamin
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden
This email sent to email@hidden