New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jpype package is not callable in Mac OS X #6

Closed
e9t opened this Issue Aug 26, 2014 · 7 comments

Comments

Projects
None yet
3 participants
@e9t
Copy link
Member

e9t commented Aug 26, 2014

Both Windows and Linux work fine with the same code, but Mac OS X produces the error below:

/Library/Python/2.7/site-packages/konlpy/tag/kkma.pyc in __init__(self, jvmpath)
      73    kkmaJavaPackage = jpype.JPackage('kr.lucypark.kkma')
      74    KkmaInterfaceJavaClass = kkmaJavaPackage.KkmaInterface
 ---> 75    self.jki = KkmaInterfaceJavaClass() # Java instance

/Library/Python/2.7/site-packages/jpype/_jpackage.pyc in __call__(self, *arg, **kwarg)
      51
      52    def __call__(self, *arg, **kwarg):
 --->  53        raise TypeError, "Package "+self.__name+" is not Callable"

@e9t e9t added bug labels Aug 26, 2014

@e9t

This comment has been minimized.

Copy link
Member

e9t commented Aug 26, 2014

이 문제 때문에 맥에서는 hannanum과 kkma 모듈이 제대로 작동을 하지 않네요.

@euphoris

This comment has been minimized.

Copy link

euphoris commented Aug 30, 2014

HannanumInterface and KkmaInterface class files are compiled using Java 7 (51.0), but Java 6 is bundled with OS X 10.9.

$ java -cp jhannanum-0.8.4.jar:bin kr.lucypark.jhannanum.comm.HannanumInterface
Exception in thread "main" java.lang.UnsupportedClassVersionError: kr/lucypark/jhannanum/comm/HannanumInterface : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

$ java -version
java version "1.6.0_65"

However, Jpype cannot load those classes after recompiling them.

@e9t

This comment has been minimized.

Copy link
Member

e9t commented Aug 30, 2014

  1. 자바 버젼 문제
    글 남겨주셔서 감사합니다 ^^ Java 7 를 requirement로 두고 있었는데, 맥 사용자분들을 비롯해서 많은 분들이 Java 6를 쓰고 있다는 것을 감안해서 6 혹은 그 이전 버젼으로 컴파일하는 것도 좋겠네요.
  2. JPype 로딩 문제
    제가 맥을 보유하고 있지 않아서 기회가 될 때만 잠깐씩 테스팅하고 있는데, 어쩌면 classpath가 JPype에 제대로 전달이 되지 않고 있는게 아닐까 합니다. 한편 같은 코드로 윈도우(!)나 리눅스에서는 잘 돌아가기 때문에, 맥 OS만의 특성이 반영되었을 수도 있다고 생각하는데, (가령 맥의 다양한 경로에 설치된 여러 파이썬 distribution들 때문에 문제가 생겼다든가...) 아직 정확한 원인은 잘 모르겠네요.
@combacsa

This comment has been minimized.

Copy link
Contributor

combacsa commented Sep 3, 2014

OS X 10.9 위에 Java 7을 얹은 상황에서도 동일한 문제가 발생합니다.

http://stackoverflow.com/questions/21006124/using-custom-java-classes-with-jpype-package-not-callable-error

조금 검색해보니 이런 것이 있기는 한데 ...

@combacsa

This comment has been minimized.

Copy link
Contributor

combacsa commented Sep 3, 2014

5325035 를 통해 해결되었습니다. 현재의 코드로 Linux 환경과 Windows 환경에서 별 문제가 없다면 이슈를 닫아도 괜찮겠습니다.

@e9t

This comment has been minimized.

Copy link
Member

e9t commented Sep 5, 2014

Ubuntu 14.04, Windows 7에서 정상작동하는 것을 확인하였습니다.
수고해주신 분들께 감사드립니다. 이슈를 닫도록 하겠습니다.

@e9t e9t closed this Sep 5, 2014

@e9t

This comment has been minimized.

Copy link
Member

e9t commented Sep 6, 2014

To note: this was an issue checked with JPype1 0.5.5.4, JDK 1.7, Mac OS X 10.9 (Mavericks).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment