Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Java console application (no Swing or AWT) starts showing up in Dock after upgrading to 1.6.0_51
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Java console application (no Swing or AWT) starts showing up in Dock after upgrading to 1.6.0_51



It's possible that you are touching some class which is recently inadvertently is touching something in the AWT Toolkit or something else that initializes the AppContext. My advice would be to set a breakpoint on Toolkit.getDefaultToolkit() or the constructor for sun.awt.AppContext and see what path leads there.

However it happens, -Djava.awt.headless=true is the correct solution to ensure your app does not attempt to connect to the window server.

Regards,
Mike Swingler
Apple Inc.

On Jun 25, 2013, at 6:35 AM, Christopher Brown <email@hidden> wrote:

> That seems to stop the dock icon appearing, so it's a workaround, and
> appreciated.
>
> However, I don't access any graphics library and I'm unaware of any
> third-party library that does either within the application (I don't
> load any libraries that should work with say images or reports or the
> desktop or whatever).  And it didn't occur previously (I upgraded from
> 1.6.0_43 to 1.6.0_51).
>
> Thanks,
> Christopher
>
>
> On 25 June 2013 00:07, Ruotsi, Wendell <email@hidden> wrote:
>> I'm not sure why it suddenly started, but you can try adding
>> "-Djava.awt.headless=true" to your command line - that's worked for me when
>> I've run console apps that accessed graphics libraries but didn't actually
>> have any GUI.
>>
>> On Jun 24, 2013, at 12:08 PM, 6/24/13, Christopher Brown wrote:
>>
>> Hi,
>>
>> Since upgrading yesterday to Apple JDK 1.6.0_51 on Mac OS X Mountain
>> Lion, a rather large application I wrote (around 100K lines of code),
>> which runs from the console ("java -jar xxx.jar", not from within an
>> ".app" folder with a ".plist") and embeds a Jetty HTTP server, has
>> suddenly started triggering a Dock icon appearing, which is a bit
>> annoying.
>>
>> I've seen webapps in the past that do this, but that's undoubtedly due
>> to the way in which such webapps get Java2D contexts for drawing.
>> None of that is happening here.
>>
>> There's been no changes to the code, and indeed it doesn't do this
>> with the latest Oracle JDK.
>>
>> Is this a bug or something I can work around?  Is it related to any
>> internal security fixes (something preparing a dialog, just in case)?
>>
>> For info, both JDKs:
>>
>> java version "1.6.0_51"
>> Java(TM) SE Runtime Environment (build 1.6.0_51-b11-457-11M4509)
>> Java HotSpot(TM) 64-Bit Server VM (build 20.51-b01-457, mixed mode)
>>
>> java version "1.7.0_25"
>> Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
>> Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
>>
>> Thanks,
>> Christopher


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >Java console application (no Swing or AWT) starts showing up in Dock after upgrading to 1.6.0_51 (From: Christopher Brown <email@hidden>)
 >Re: Java console application (no Swing or AWT) starts showing up in Dock after upgrading to 1.6.0_51 (From: "Ruotsi, Wendell" <email@hidden>)
 >Re: Java console application (no Swing or AWT) starts showing up in Dock after upgrading to 1.6.0_51 (From: Christopher Brown <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.