1

My goal: Running Processing.org (version 3.5.4) from Max (cycling74) version 8 on Windows 10 64 through writing an MXJ external (Max Java support). I want to open a processing test sketch within window from MAX by 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
```JAVA
Sumit Singh
  • 487
  • 5
  • 19
gerome
  • 41
  • 6

1 Answers1

1

I found a post which suggests that there is a problem with Max using Processing´s OpenGL related capacities: "since OpenGL uses also native libraries (*.dll files) and not only *.jar files. I don't know if its possible in MaxMSP - that depends on how they set up their JVM." https://forum.processing.org/one/topic/use-processing-from-within-max-msp-or-from-matlab.html

gerome
  • 41
  • 6
  • Welcome to SO! Please don't post link-only answers but summarize the linked content or its relevant parts a little. A link may become invalid or outdated and in that case, your answer would be useless in the future. – ahuemmer Aug 26 '22 at 06:24