Processing can find the data folder in Windows 11 but not in Linux or Mac

I also notice that you are using a PApplet and in my tests loadImage() will not work in a PApplet on a mac without using the path to the image, ie loadImage(“/Users/xxxx/Documents/Processing/myApp/data/myImg.png“)

When I tried just loadImage(“myImg.png“) I got a null pointer and this error message:

The file “quads.png” is missing or inaccessible, make sure the URL is valid or that the file has been added to your sketch and is readable.

Source code:

PImage img;

class TestWindow extends PApplet {
TestWindow () {
PApplet.runSketch(new String
 {this.getClass().getSimpleName()}, this);
}

void settings() {
size(600, 600);
}

void setup() {
// This works
img = loadImage(“/Users/xxxx/Documents/Processing/myApp/data/quads.png”);
// This fails
//  img = loadImage(“quads.png”);
}

void draw() {
image(img, 0, 0);
}
}

TestWindow testWindow;

void setup() {
surface.setVisible(false);
testWindow = new TestWindow();
}

Output: