Grr Apple, your Java update broke my programs

Discussion in 'Mac Programming' started by wrldwzrd89, Jun 21, 2009.

  1. wrldwzrd89 macrumors G5


    Jun 6, 2003
    Solon, OH
    I am quite angry at Apple now... their most recent Java update (which included security updates) seems to have introduced a most annoying bug, that wasn't there before. Namely, whenever a dialog comes up, the menu bar gets obliterated and doesn't come back. In my testing, all versions of all my Java GUI programs are affected. I'm definitely going to switch my primary programming language... or use a mix of languages now, rather than just Java, 'cause it seems Apple doesn't care about Java anymore. What a shame. :(:mad:

    Now that that's off my chest... I'm wondering where to go from here. I mostly program games these days. With that in mind... I'm trying to decide what language or language mixture to use. I've whittled down the options to these:
    • Pure Python
    • Python backend, Obj-C frontend (Mac OS X) / C# frontend (Windows) / C++ frontend (Linux)
    • C backend, Obj-C frontend (Mac OS X) / C# frontend (Windows) / C++ frontend (Linux)
    By backend I mean the logic and data access parts of the program, and by frontend I mean the GUI.
  2. mathcolo macrumors 6502a

    Sep 14, 2008
    I think you'll find this option the easiest to go with:

    C backend, Obj-C frontend (Mac OS X) / C# frontend (Windows) / C++ frontend (Linux)

    Because C and Obj-C are 100% compatible on Mac OS X and it won't require that much work to get the rest working.
  3. foidulus macrumors 6502a

    Jan 15, 2007
    Just FYI, I've been following the Apple Java dev lists, and the Apple engineer who monitors the threads acknowledges the bug and apparently they are working on fixing it. The current workaround is to make sure the dialog's parent isn't null(the engineer suggested a visible frame, most likely the frame of the app that created the window)
  4. wrldwzrd89 thread starter macrumors G5


    Jun 6, 2003
    Solon, OH
    Thanks! That's good to know.
  5. foidulus macrumors 6502a

    Jan 15, 2007
    I just found the relevant post:

    >> Has anyone noticed their menu bar items not dynamically enabling/
    >> disabling correctly under their Java applications running the new
    >> 1.5.0_19-b02-304 32-bit release for Leopard? 1.5.0_16-b06-284 still
    >> seems to work fine...?
    >> Yeah, my app does this too - and then it crashes with a SIGSEGV in
    >> the AWT-AppKit daemon. For me, it seems to be related to
    >> apple.laf.useScreenMenuBar and dynamically modifying menus (I both
    >> enable/disable items and for some use a MenuListener to update the
    >> menu in the menuSelected method). I've filed bug #6975997 and I
    >> have a DTS incident #76450571 open. Let's hope it gets fixed soon -
    >> my customers are not happy.
    >> A workaround (that I can't really use for production) is to set
    >> apple.laf.useScreenMenuBar = false. FWIW.
    > Thanks for the bug#'s. I'm not seeing the crash, but at this point
    > all bets are off. :) :) Basically the only other alternative I've
    > found so far is recreate the entire JMenuBar and set the main menu
    > bar to it again which causes the dreaded java/menu "flicker from
    > hell" which our clients are already complaining about. :)
    > My personal history with Apple / Java VM issues is that they don't
    > get fixed too quickly, so unless the version someone gets retracted
    > I don't know if I can hold out for a fix...
    > If anyone has a suggestion of how I can get around the enable/
    > disable bug without have to reset the application Menu Bar or a way
    > to cut down on the flicker when I DO reset it, I'd love to hear
    > about it. Meanwhile, I'll keep trying various things and let you
    > know if I find anything...

    FYI, the issue with not restoring them menu has to do with the menu
    bar being swapped out when the underlying NSWindow receives a -
    windowDidBecomeMain: instead of -windowDidBecomeKey:. Unfortunately,
    this is code deep in the native parts of the AWT, so a Java user-space
    workaround does not seem possible, besides passing a non-null, visible
    parent to the dialog constructor.

    The crash is a subtle correctness issue regarding autoreleased
    objects, which is still under investigation.

    Mike Swingler
    Java Runtime Engineer
    Apple Inc.
  6. Elbon macrumors 6502a


    Jan 9, 2008
    Boston, MA
    DnD is also broken

    The latest update also broke drag and drop. Drag contents are not recognized the first time the user drags over the window, but are recognized on subsequent drag enters. I filed a bug report but I haven't gotten any confirmation (issue #6986461).

    The update also broke some of my Eclipse projects, which rely on features in Java Web Start and the Java plugin (javaws.jar and plugin.jar). These files aren't on the Eclipse classpath by default, but it has always been possible to manually add them to the JRE configuration. Now, it isn't. I also submitted this issue (#6984228).

    Overall, I'm very disappointed (and frustrated) with this update.
  7. MorphingDragon macrumors 603


    Mar 27, 2009
    The World Inbetween
    I think I know why people avoid Java now. :eek: I recall windows and other systems having similar breakages after the "Fix", like at work. The servers run Linux and our Java Database program broke when Java first patched the problem.

    I dont use C#, Visual Studio is and .Net is needless bloat for myself and the user.

    Why not just use C++ on each system as a backend?
  8. wrldwzrd89 thread starter macrumors G5


    Jun 6, 2003
    Solon, OH
    Gosh, why didn't I think of that before? I can use Objective-C++ on the Mac, and pure C++ everywhere else... brilliant!

Share This Page