lucene-pylucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Janssen <jans...@parc.com>
Subject Re: using org.apache.jcc.PythonVM
Date Fri, 04 Mar 2011 17:42:59 GMT
Andi Vajda <vajda@apache.org> wrote:

> Something's off. libjcc.so is not shown in your list.
> You need to solve that mystery before embedding can proceed.

So, I went to my Mac, and looked for libjcc.dylib.  Sure enough,
it's there.  So I tried this simple program:

import org.apache.jcc.PythonVM;

public class test {

    public static void main (String[] argv) {
        PythonVM.start("/usr/bin/python",
             new String[] { "-c", "import time; print time.localtime()"});
    }
}

Here's what happens:

% javac -classpath /Library/Python/2.5/site-packages/JCC-2.6-py2.5-macosx-10.5-i386.egg/jcc/classes:.
test.java
% java -Djava.library.path=/Library/Python/2.5/site-packages/JCC-2.6-py2.5-macosx-10.5-i386.egg
-classpath /Library/Python/2.5/site-packages/JCC-2.6-py2.5-macosx-10.5-i386.egg/jcc/classes:.
test
Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/Python/2.5/site-packages/JCC-2.6-py2.5-macosx-10.5-i386.egg/libjcc.dylib:
 Symbol not found: __Py_NoneStruct   Referenced from: /Library/Python/2.5/site-packages/JCC-2.6-py2.5-macosx-10.5-i386.egg/libjcc.dylib
  Expected in: dynamic lookup 
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1824)
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1748)
	at java.lang.Runtime.loadLibrary0(Runtime.java:822)
	at java.lang.System.loadLibrary(System.java:993)
	at org.apache.jcc.PythonVM.<clinit>(PythonVM.java:23)
	at test.main(test.java:6)
% otool -L /Library/Python/2.5/site-packages/JCC-2.6-py2.5-macosx-10.5-i386.egg/libjcc.dylib
/Library/Python/2.5/site-packages/JCC-2.6-py2.5-macosx-10.5-i386.egg/libjcc.dylib:
	@rpath/libjcc.dylib (compatibility version 2.6.0, current version 2.6.0)
	/System/Library/Frameworks/JavaVM.framework/Versions/A/JavaVM (compatibility version 1.0.0,
current version 1.0.0)
	/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.4.0)
	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.5)
%

Bill

Mime
View raw message