I'm writing a Scala program which uses a C++ shared object, loaded through JNA, to call some custom file reading functions which we have written in C++ and would prefer not to maintain a Java/Scala copy of as well. The program only needs to be Linux compatible.
My question is, what's the appropriate way to check is the shared object is available programatically? If the user has forgotten to add the shared object to their LD_LIBRARY_PATH, the GUI will crash when they try and use some functionality from it. I'd like to do a check at launch time to ensure that the shared object is available - I can attempt to do a read and then catch any errors, but that requires a file to read from and just doesn't feel like the right way to do it.
Any ideas? Many thanks.