Reputation: 71
I'm using some C++ code through JNI in Java. The C++ code uses some functions from libstdc++ and libz. The C++ part is linked into a shared library and than that built library is used on different environments(linux-based).
My concern is the libstdc++ and libz versions differences. If I built that JNI library on environment A and than it went to environments B and C which might have other libstdc++ and libz versions - will it fail? And does that mean I need to link those libraries into my JNI shared library statically?
P.S. The first test of 2 slightly different environments succeeded, but still I don't feel safe here.
Upvotes: 0
Views: 415
Reputation: 9474
This is no different from non-JNI usage of the C++. Generally, library provider strive to ensure backward compatibility - so in most cases your concern is not to stumble upon a version that is too old.
There are several common options:
Upvotes: 2