Got a quick little question.
This past week, I’ve been working on some Java projects on my windows PC at home using Processing for the graphics. I’ve been using the ItelliJ IDE to add the processing library to the project, and it’s been working just fine.
Today however, I was away from home, and wanted to try and see if I could work on my MacBook as well. I went through the same steps for downloading the IntelliJ IDE and Processing, and adding Processing to the project. But this time after I try to run my program, I keep getting “java.lang.NoClassDefFoundError” errors.
I made a small trial program that should just make the box to draw in and a small circle inside the box, but the same error occurs. The line it points to as the error is where I declare the PApplet.main(“Classname”);
I’m unsure if this is just a Mac problem, or if there’s something else I have to do that I didn’t have to on my windows PC. But if you can help shed some light on what could be causing this problem, that’d be greatly appreciated.
This is the little test program I made that should just draw a circle to the screen. The consul showed a java.lang.noClassDefFoundError at the one line in the main method.
import processing.core.PApplet;
public class Test extends PApplet
{
public static void main()
{
PApplet.main("Test");
}
public void setup() {}
public void settings()
{
size(300, 300);
}
public void draw()
{
ellipse(150, 150, 50, 50);
}
}
This is the Error message I received:
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:10855)
at processing.core.PApplet.main(PApplet.java:10650)
at processing.core.PApplet.main(PApplet.java:10632)
at Test.main(Test.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