Getting null pointer trying to load texture with LWJGL 3 w/ runnable jar

I’m using

ByteBuffer data = stbi_load(file, width, height, comp, 4);

to put my png files into the game but when I create a runnable jar the app can’t find my files.

The structure is like this


Project {
	src {
		Artist {
			Texture(String file) {
				// passing   "./Resources/texture/mytexture.png"
				ByteBuffer data = stbi_load(file, width, height, comp, 4);
			}
		}
	}

	Resources { // this is included as a source folder in the build path
		texture {
			mytexture.png
		}
		
	}		

}


the files will load when I launch from eclipse but not from a runnable jar :frowning:

EDIT:

Found this

For now I’m loading them in as BufferedImages via ImageIO.read(getClass().getResourceAsStream(file)) method call