Dependency not found error

Chris's icon

My goal: running Processing.org (version 3.5.4) from within Max 8 through writing an mxj external on Windows 10, 64 . I want to open a Processing test sketch window from within Max sending a bang message to the mxj external. For this I have
class MaxJavaTest3 extends MaxObject which calls
class TestProcessing extends PApplet.

public class MaxJavaTest3 extends MaxObject {
public void bang() {
String[] args = {};
TestProcessing.main(args);
}
}

public class TestProcessing extends PApplet {
public static void main(String args[] ) {
PApplet.main("TestProcessing", args);
}

public void settings() {
size(920, 780);
}

public void setup() {
background(0);
fill(255, 0, 0);
circle(width/2, height/2, 80);
}
}

In IntelliJ I set the dependencies for Max and Java. The bang message is received in Java e.g. triggering some text messages to the console. If I execute PApplet.main via the entry point TestProcessing.main, the processing window opens. So far so good, but trying to invoke PApplet.main via MaxJavaTest3.bang() method I get the error:

java.lang.RuntimeException: java.lang.ClassNotFoundException: TestProcessing
    at processing.core.PApplet.runSketch(PApplet.java:10852)
    at processing.core.PApplet.main(PApplet.java:10657)
    at TestProcessing.main(TestProcessing.java:11)
    at MaxJavaTest3.bang(MaxJavaTest3.java:19)
Caused by: java.lang.ClassNotFoundException: TestProcessing
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    at processing.core.PApplet.runSketch(PApplet.java:10845)
    ... 3 more

I tried out different paths for the .jar dependencies but no success. I add here the relevant parts of my max.java.config.txt for reference:

; add all jars in /Users/topher/java/lib to the system classpath i.e. immutable classpath ;
max.system.jar.dir "C:/Users/CLEVO Computer/Documents/Java/lib"

; add /Users/topher/myclasses to the dynamic classpath of MXJClassLoader ;
max.dynamic.class.dir "C:/Users/CLEVO Computer/Max_Java_Test/MaxJavaTest3/out/production/MaxJavaTest3"

; specify some jvm options ;
max.jvm.option -Xincgc
max.jvm.option -Xms64m
max.jvm.option -Xmx256m