I found this[1] section in the documentation on interoperability within the JVM. It looks fairly straightforward to work with. I'm not sure about FFI more generally.
Enforcing and incentivizing collaboration also seems like a good argument for licensing open source projects with the AGPL. It prevents people who are not willing to contribute things made using your software back to open source from using it.
[1] https://doc.flix.dev/interoperability/