java - Error installing pyjnius, "jni.h" not found. (OS X 10.10.1) -


i have been trying install pyjnius on os x 10.10.1. other dependencies taken care of, haven't been able solve issue of header file "jni.h" not being found. here's happens:

$ sudo python setup.py install /system/library/frameworks/python.framework/versions/2.7/lib/python2.7/distutils/dist.py:267: userwarning: unknown distribution option: 'install_requires'   warnings.warn(msg) running install running build running build_py running build_ext skipping 'jnius/jnius.c' cython extension (up-to-date) building 'jnius' extension cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -os -pipe -fno-common -fno-strict-aliasing -fwrapv -denable_dtrace -dmacosx -dndebug -wall -wstrict-prototypes -wshorten-64-to-32 -dndebug -g -fwrapv -os -wall -wstrict-prototypes -denable_dtrace -arch x86_64 -arch i386 -pipe -i/system/library/frameworks/javavm.framework/versions/a/headers -i/system/library/frameworks/python.framework/versions/2.7/include/python2.7 -c jnius/jnius.c -o build/temp.macosx-10.10-intel-2.7/jnius/jnius.o jnius/jnius.c:238:10: fatal error: 'jni.h' file not found #include "jni.h"          ^ 1 error generated. error: command 'cc' failed exit status 1 

[if makes difference, have tried using pip, terminates same error.]

the java versions installed 1.6.0.65 , 1.8.0.25. can switch between them if required.

if helps, able find jni.h using locate. it's located here:

/applications/xcode.app/contents/developer/platforms/macosx.platform/developer/sdks/macosx10.10.sdk/system/library/frameworks/javavm.framework/versions/a/headers/jni.h /applications/xcode.app/contents/developer/platforms/macosx.platform/developer/sdks/macosx10.9.sdk/system/library/frameworks/javavm.framework/versions/a/headers/jni.h /library/java/javavirtualmachines/jdk1.8.0_25.jdk/contents/home/include/jni.h 

any appreciated!

okay, turns out pretty close answer. navigated /system/library/frameworks/javavm.framework/versions/a, , created directory called headers. symlinked jni.h.

ln -s /applications/xcode.app/contents/developer/platforms/macosx.platform/developer/sdks/macosx10.10.sdk/system/library/frameworks/javavm.framework/versions/a/headers/jni.h jni.h 

running setup script again threw error, time 1 jni_md.h. symlinking again,

ln -s /applications/xcode.app/contents/developer/platforms/macosx.platform/developer/sdks/macosx10.10.sdk/system/library/frameworks/javavm.framework/versions/a/headers/jni_md.h jni_md.h 

- worked! ran setup again, , can import jnius.

if has easier workaround, post it.


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -