Cannot load .dylib in Processing 4?

I made a library that loads a .dylib file and calls some functions from it. Since the upgrade to Processing 4, the library can’t find the dylib and throws an error when trying to load it:

UnsatisfiedLinkError: Unable to load library ‘ftd2xx’: Native library (darwin/libftd2xx.dylib) not found in resource path

I’m loading the library like this:

Native.loadLibrary("ftd2xx", FTDI_D2XX.class);

Processing3 searches in /usr/local/lib/ for dylibs but I’m not sure where P4 is looking for the dylibs?

any ideas?

I’ve managed to make it point to the correct location now. But another questions…
How can I get the location of the libraries folder from with a Processing app? Is there some builtin variable?