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/SarApi.py", line 8, in <module>
    from SarPipeline import SarPipeline
  File "/Users/ciaran/prco304/prco304-backend-sar/src/SarPipeline.py", line 1, in <module>
    from SarProcessor import SarProcessor
  File "/Users/ciaran/prco304/prco304-backend-sar/src/SarProcessor.py", 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/__init__.py", line 63, in <module>
    jpyutil.preload_jvm_dll()
  File "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/snappy/jpyutil.py", 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/__init__.py", 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 jpyconfig.py file which is located in ...\Lib\site-packages\snappy

2 Likes

Cheers @marpet

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