2 Replies Latest reply: Dec 12, 2012 9:21 AM by 979526 RSS

    CGContextGetCTM: invalid context 0x0 errors on OSX

    942173
      It would appear that the latest version of Java (as supplied by Apple Update) and/or the latest version of OSX do not get along as well as they should. If you search for one of the error messages below you will see a lot of people are getting these error messages (usually in some console output window or script) but I'm not sure if Oracle / Apple are aware of the problem and indeed if it's Java or OSX update related. Apparently the latest Java 7 from Oracle does not correct the error.

      <Error>: CGContextGetCTM: invalid context 0x0
      <Error>: CGContextSetBaseCTM: invalid context 0x0
      <Error>: CGContextGetCTM: invalid context 0x0
      <Error>: CGContextSetBaseCTM: invalid context 0x0

      As far as I can tell it's not actually preventing anything from working. I get the output below in my Eclipse IDE console output window along with all my other logger output.

      Where would I need to look to see if there is a proper bug report registered and if there is a patch/update pending.

      Took me ages just to get an account working on this website - the Oracle user logon process seems very unreliable and unpredictable.
        • 1. Re: CGContextGetCTM: invalid context 0x0 errors on OSX
          950848
          I have been receiving these errors too when running certain java class files through Terminal. I am using java 7 update 5 for Mac OSX.

          This shows some other people with the same problem:
          http://forum.processing.org/topic/java-errors

          Edited by: 947845 on Jul 20, 2012 4:27 PM
          • 2. Re: CGContextGetCTM: invalid context 0x0 errors on OSX
            979526
            Maybe I can narrow down the search for causes.
            My Java application produces the exact same error message only when I execute those lines:

            final java.net.URL url = ProjectVanNimwegenBacteria.class.getResource("gui/media/IconMotherMachine64.png");

            final Toolkit kit = Toolkit.getDefaultToolkit();

            final Image img = kit.createImage(url);

            guiFrame.setIconImage(img);



            If I take them out they vanish.

            Hope that helps,

            Florian