Not without suitable glue code, you can’t. If you want to use a native library with Java or Node.js, you need to wrap it in a JNI or N-API wrapper. The wrapper must be dynamically linked, but the native library can be statically linked with the wrapper. My current project does just that, in fact.
There is one exception I know of. The Java library JNA dynamically links native libraries into a Java program and generates the necessary glue at run time.
Not without suitable glue code, you can’t. If you want to use a native library with Java or Node.js, you need to wrap it in a JNI or N-API wrapper. The wrapper must be dynamically linked, but the native library can be statically linked with the wrapper. My current project does just that, in fact.
There is one exception I know of. The Java library JNA dynamically links native libraries into a Java program and generates the necessary glue at run time.