# Error: "Hello Processing" / JDK 10 / OSX High Sierra / com/apple/eawt/QuitHandler not supported

**URL:** <https://discourse.processing.org/t/error-hello-processing-jdk-10-osx-high-sierra-com-apple-eawt-quithandler-not-supported/1396>\
**Category:** Processing\
**Created:** [June 30, 2018, 8:50pm UTC](https://discourse.processing.org/t/error-hello-processing-jdk-10-osx-high-sierra-com-apple-eawt-quithandler-not-supported/1396 "2018-06-30T20:50:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hepi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/hepi/32/618_2.png) [@hepi](https://discourse.processing.org/u/hepi)\
**Post date:** [June 30, 2018, 8:50pm UTC](https://discourse.processing.org/t/error-hello-processing-jdk-10-osx-high-sierra-com-apple-eawt-quithandler-not-supported/1396/1 "2018-06-30T20:50:54Z")

</div>

Hi,

I am trying to run a “Hello Processing” Java application (using Eclipse photon),  
with OSX High Sierra (10.13.x), having Java jdk 10.  
Is it supported?

This is the code:

```auto
import processing.core.PApplet;
public class UsingProcessing extends PApplet{
	public static void main(String[] args) {
		PApplet.main("UsingProcessing");
	}
}

```

This is the error I get:

```auto
java.lang.NoClassDefFoundError: com/apple/eawt/QuitHandler
	at java.base/java.lang.Class.getDeclaredMethods0(Native Method)
	at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3119)
	at java.base/java.lang.Class.getMethodsRecursive(Class.java:3260)
	at java.base/java.lang.Class.getMethod0(Class.java:3246)
	at java.base/java.lang.Class.getMethod(Class.java:2065)
	at processing.core.PApplet.runSketch(PApplet.java:10707)
	at processing.core.PApplet.main(PApplet.java:10504)
	at processing.core.PApplet.main(PApplet.java:10486)
	at UsingProcessing.main(UsingProcessing.java:7)
Caused by: java.lang.ClassNotFoundException: com.apple.eawt.QuitHandler
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
	... 9 more

```

---

<div class="post-metadata">

**Author:** ![monkstone](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/monkstone/32/64_2.png) [@monkstone](https://discourse.processing.org/u/monkstone)\
**Post date:** [July 1, 2018, 6:14am UTC](https://discourse.processing.org/t/error-hello-processing-jdk-10-osx-high-sierra-com-apple-eawt-quithandler-not-supported/1396/2 "2018-07-01T06:14:18Z")

</div>

In a word no. You need to stick to jdk8, use of proprietary code in java has been warned about for years, finally they really mean it. Processing uses proprietary code `com.apple.eawt.*` in a number of areas to deal with MacOS specific foibles. See [https://github.com/processing/processing/wiki/Supported-Platforms](https://github.com/processing/processing/wiki/Supported-Platforms) for when [processing.org](http://processing.org) might do something about it. It might be worth trying to put this jar [https://github.com/processing/processing/blob/master/core/apple.jar](https://github.com/processing/processing/blob/master/core/apple.jar) on your path.

---

<div class="post-metadata">

**Author:** ![paulrene](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/paulrene/32/12929_2.png) [@paulrene](https://discourse.processing.org/u/paulrene)\
**Post date:** [April 25, 2021, 12:20pm UTC](https://discourse.processing.org/t/error-hello-processing-jdk-10-osx-high-sierra-com-apple-eawt-quithandler-not-supported/1396/3 "2021-04-25T12:20:59Z")

</div>

I’m very late to the party, but I found this post because I had the exact same issue in April 2021, running Java 11 on Mac with the latest 3.3.7 Processing core.jar. After digging around I found that the internal Mac APIs that Processing has been misusing to add a proper quithandler and set a dock icon has now been removed and replaced by official AWT APIS. There is a class inside Processing called ThinkDifferent that is loaded by reflection when Mac is detected and this class was calling the now removed APIs. To solve this I reimplemented this class using the new official APIs and just added a new processing.core.ThinkDifferent class to my project that solved the issue.

```auto
package processing.core;

import java.awt.Desktop;
import java.awt.Image;
import java.awt.Taskbar;
import java.awt.desktop.QuitEvent;
import java.awt.desktop.QuitHandler;
import java.awt.desktop.QuitResponse;

public class ThinkDifferent {

  // True if user has tried to quit once. Prevents us from cancelling the quit
  // call if the sketch is held up for some reason, like an exception that's
  // managed to put the sketch in a bad state.
  static boolean attemptedQuit;

  public static void init(final PApplet sketch) {
    Desktop desktop = Desktop.getDesktop();
    desktop.setQuitHandler(
        new QuitHandler() {
          @Override
          public void handleQuitRequestWith(QuitEvent e, QuitResponse response) {
            sketch.exit();
            if (PApplet.uncaughtThrowable == null && !attemptedQuit) {
              response.cancelQuit();
              attemptedQuit = true;
            } else {
              response.performQuit();
            }
          }
        });
  }

  public static void cleanup() {
    Desktop.getDesktop().setQuitHandler(null);
  }

  // Called via reflection from PSurfaceAWT and others
  public static void setIconImage(Image image) {
    Taskbar.getTaskbar().setIconImage(image);
  }
}

```

---

<div class="post-metadata">

**Author:** ![sarahhoworka](https://avatars.discourse-cdn.com/v4/letter/s/8c91f0/32.png) [@sarahhoworka](https://discourse.processing.org/u/sarahhoworka)\
**Post date:** [June 9, 2022, 1:39pm UTC](https://discourse.processing.org/t/error-hello-processing-jdk-10-osx-high-sierra-com-apple-eawt-quithandler-not-supported/1396/4 "2022-06-09T13:39:45Z")

</div>

thank you Paul, this allowed me to use Processing in Visual Studio Code with JDK 11 on Mac OS 12.3.

---

<div class="post-metadata">

**Author:** ![dehyde](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/dehyde/32/5153_2.png) [@dehyde](https://discourse.processing.org/u/dehyde)\
**Post date:** [December 14, 2022, 4:05pm UTC](https://discourse.processing.org/t/error-hello-processing-jdk-10-osx-high-sierra-com-apple-eawt-quithandler-not-supported/1396/5 "2022-12-14T16:05:17Z")

</div>

@paulrene Thanks for that code

I’m trying to run processing in Maven, but I can’t edit the .ThinkDifferent.class file in the Maven dependency.  
Any idea on how I can still get it to work with your code?
