Java – install jpype in mountain lion

I'm trying to install jpype.com in mountain lion I follow all the steps suggested in this article: how to install jpype on OS X lion to use with neo4j?

However, the mountain lion has a glitch I modified the setupmacosx() function as follows:

/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/JavaVM.framework/

But when I run $sudo Python setup Py install, I received the following error:

src/native/common/include/jpype.h:45:10: Fatal error: 'jni.h' file not found

I found JNI here H head:

/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/jni.h

But because of JNI H is not part of mountain lion. I haven't figured out how to modify setup Py file to fix the bug Any suggestions?

Solution

This is running OSX 10.8 5 on the system

I modified jpype-0.5 4.2 setup Py, and in self An element is added at the end of the includedirs list, which is created in the function setupinclusion For this particular version of jpype, this function is declared on line 61

def setupInclusion(self):
          self.includeDirs = [
              self.javaHome+"/include",self.javaHome+"/include/"+self.jdkInclude,"src/native/common/include","src/native/python/include",#I added this line below. The folder contains a jni.h
              "/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/"
          ]

Finally, I ran PIP install ~ / path / to / jpype folder / and the installation was successful

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>