Why the exported to desktop (.exe) Processing app with Java classes can not work run properly?

I try to export my processing app as the “ready to use” application with exe launch file for desktop. My code is pretty simple. Proccessing code:

private io.itch.mgdsstudio.airfight.connecteddevices.Controller controller;   

void setup(){   
  size(600,800,  JAVA2D);
   background(0);
   //I think the next code line can not be launched after export. Background stays black
   controller = new io.itch.mgdsstudio.airfight.connecteddevices.Controller(this);
}

void draw(){      
  controller.render();        
}

and the java-class:

package io.itch.mgdsstudio.airfight.connecteddevices;
import processing.core.PApplet;

public class Controller {
   private PApplet engine;

    public Controller(PApplet engine) {
       this.engine = engine;
    }
   
    public void render(){
        engine.background(255,0,0);        
    }
}

The application runs perfect from processing ide - the screen is red. But after export it can not run properly. The screen is black. I tested processing 3 and 4.

I tried to change code so:

import io.itch.mgdsstudio.airfight.connecteddevices.Controller;
private Controller controller;   

void setup(){   
  size(600,800,  JAVA2D);
   background(0);   
   controller = new io.itch.mgdsstudio.airfight.connecteddevices.Controller(this);
}

void draw(){      
  controller.render();        
}

I receive the message in the console:
No library found for io.itch.mgdsstudio.airfight.connecteddevices
but it runs in the ide. But after export it can not run properly again.

I think due to the way Processing manages the files in the background it’s not possible to create packages. If you really want to build packages but also want to use Processing, I recommend using plain Java with the Processing library with IntelliJ or Eclipse. On this page you can read how to set this up.

Can you trust me or not, but I create games using Intellij IDEA. I append processing as the core library with jar extension. But after that I need to publish my games not as launchable Jar file, but as standalone application with the executable launcher (.exe for Windows and .sh for Linux) and an embedded java. That is why I use pde for exporting after the project was created in intellij IDEA. But right now I can only pack my compiled project into a jar and append it to the processing project as the library to export. It works