JOGL Error when running Processing 4.0b8 on external IDE with Apple Silicon

I originally had a repo for Windows that was working perfectly and I assumed that all I had to do was clone the repo and change the x86 jars to ARM, and that worked for Processing but IntelliJ isn’t recognizing Jogamp.
I am sure that Processing is consistent with their JOGL version as Processing standalone does work, but not with IntelliJ.

java.lang.UnsatisfiedLinkError: Can’t load library: /Users/Ailun/Documents/GitHub/Tut/natives/macosx-universal/gluegen_rt
at java.base/java.lang.ClassLoader.loadLibrary(
at java.base/java.lang.Runtime.load0(
at java.base/java.lang.System.load(
at com.jogamp.common.jvm.JNILibLoaderBase.loadLibraryInternal(
at com.jogamp.common.jvm.JNILibLoaderBase.access$000(
at com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(
at com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary(
at com.jogamp.common.os.DynamicLibraryBundle$GlueJNILibLoader.loadLibrary(
at com.jogamp.common.os.Platform$
at java.base/
at com.jogamp.common.os.Platform.(
at com.jogamp.nativewindow.NativeWindowFactory$
at java.base/
at com.jogamp.nativewindow.NativeWindowFactory.(
at com.jogamp.newt.NewtFactory$
at java.base/
at com.jogamp.newt.NewtFactory.(
at processing.opengl.PSurfaceJOGL.initIcons(
at processing.opengl.PSurfaceJOGL.initFrame(
at processing.core.PApplet.initSurface(
at processing.core.PApplet.runSketch(
at processing.core.PApplet.main(
at Main.main(

There didn’t exist a natives/macosx-universal folder so I created it and added the gluegen-rt.jar to it, however it has not fixed the issue.
I have added the folder to the classpath too (I’m using IntelliJ with Gradle so I also added it to the, but that didn’t work either.

I would greatly appreciate any help!

Did you import the Processing ‘core’ library into IntelliJ?

Yes, I have.

import processing.core.PApplet;

public class Main extends PApplet {

    public void settings(){
        size(600,600, P2D); // If I remove P2D, it works!

    public void setup(){}
    public void draw(){}

    public static void main(String[] args) {

I observed basically the same thing on BigSur; removing ‘P2D’ allows it to compile without error. I think natives/macosx-universal/gluegen_rt is a jar file. There are several versions online that may be downloaded, but so far adding these to the project folder has not fixed it.

I had to import all the JOGL and gluegen jar files to get P2D working in IntelliJ.