Snappy not pointing to right Java Home

Hi there,

Not sure what’s happened but suddenly my snappy installation seems to thinking Java is somewhere it isn’t:

    Traceback (most recent call last):
  File "/Users/ciaran/prco304/prco304-backend-sar/src/", line 8, in <module>
    from SarPipeline import SarPipeline
  File "/Users/ciaran/prco304/prco304-backend-sar/src/", line 1, in <module>
    from SarProcessor import SarProcessor
  File "/Users/ciaran/prco304/prco304-backend-sar/src/", line 1, in <module>
    from snappy import ProductIO, HashMap, GPF, jpy
  File "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/snappy/", line 63, in <module>
  File "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/snappy/", line 344, in preload_jvm_dll
    return ctypes.CDLL(jvm_dll_file, mode=ctypes.RTLD_GLOBAL)
  File "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/", line 362, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: dlopen(/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/server/libjvm.dylib, 10): image not found

It should be pointing at /Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/bin/java

Any suggestions?

Many thanks!

It’s working on my centos boxes but not my Mac, which isn’t handy as I need it working so I can debug my code!

Probably you updated your JDK and snappy does not know about it.

You need to change the java_home property in the file which is located in ...\Lib\site-packages\snappy


Cheers @marpet

That was it, I forgot to post when I fixed it!