snappy-java icon indicating copy to clipboard operation
snappy-java copied to clipboard

Problems with included native library on FreeBSD, potentially others

Open borjam opened this issue 1 year ago • 0 comments

I have stumbled upon a problem when using a snappy-java library bundled with a software package.

In my case my operating system is FreeBSD 14.1. The bundled native library seems to be much older, trying to link to the non existant libstdc++.so.6.

I have noticed that as a default snappy-java determines which native library it will need (in this case, FreeBSD) and unpacks it from the .jar file to a temporary directory. I have just started the program and the file name is:

/tmp/snappy-1.1.10-3a114908-1cf9-4b6e-a1b2-620bc8b26ea9-libsnappyjava.so

As I am using FreeBSD I have compiled snappy-java from ports myself (trivial task) and it installs two libraries:

snappyjava-1.1.10.5:
	/usr/local/lib/libsnappyjava.so. (the locally compiled native library)
	/usr/local/share/java/classes/snappy-java.jar

So, I think it would be ideal to:

  1. Check whether there is a native library installed. If present, link to it.
  2. If there is no native library, then use the bundled one as a last resort measure.

What do you think?

borjam avatar Oct 09 '24 09:10 borjam