[pylucene-dev] Re: using JCC
Andi Vajda
vajda at osafoundation.org
Wed Feb 20 00:31:04 PST 2008
On Feb 19, 2008, at 20:50, Bill Janssen <janssen at parc.com> wrote:
>> Do you need to wrap the good stuff _and_ the cruft or can you get
>> away with
>> just wrapping the good stuff ?
>
> Just the good stuff.
>
>> If you don't need to generate wrappers for code in Support.jar,
>> then don't
>> include it with --jar. Yes, you still need it on your classpath for
>> the
>> classes in GoodStuff.jar to load but that's a different issue.
>
> Yes, that's what I want, and that's the first thing I tried. But just
> setting the CLASSPATH environment variable doesn't seem to work. I
> run
>
> % setenv CLASSPATH GoodStuff.jar:Support.jar
> % python -m jcc --jar GoodStuff.jar
> Traceback (most recent call last):
> File "/usr/lib/python2.5/runpy.py", line 95, in run_module
> filename, loader, alter_sys)
> File "/usr/lib/python2.5/runpy.py", line 52, in _run_module_code
> mod_name, mod_fname, mod_loader)
> File "/usr/lib/python2.5/runpy.py", line 32, in _run_code
> exec code in run_globals
> File "/usr/lib/python2.5/site-packages/JCC-1.7-py2.5-linux-i686.egg/
> jcc/__init__.py", line 28, in <module>
> cpp.jcc(sys.argv)
> File "/usr/lib/python2.5/site-packages/JCC-1.7-py2.5-linux-i686.egg/
> jcc/cpp.py", line 332, in jcc
> cls = env.findClass(className.replace('.', '/'))
> jcc.cpp.JavaError: java.lang.NoClassDefFoundError: com/parc/foo/Bar
> %
>
> The com.parc.foo.Bar class is in Support.jar. It only seems to be
> found if I run
>
> % python -m jcc --jar GoodStuff.jar --jar Support.jar
>
> So, how does JCC find the classpath? Suppose I could read the code,
> but that would be cheating... :-) Ah, the "--classpath" arg isn't
> documented
> in the README.
Uh uh. Definitely not cheating. You have the sources. Use them :)
Still, an oops. That flag should be documented.
Andi..
>
>
> Ah, that did the trick! Might want to make it look at CLASSPATH...
>
>> Before feeding stuff to JCC, you should really carefully read the
>> topic
>> about all the command line args it can take in [2] if you haven't
>> done so
>> already. For example, the invocation you're using above is not
>> going to
>> generate any wrappers for use with Python, only the ones for use
>> with C++.
>
> Yes, I've carefully read it. I'm just trying to get it generate *any*
> wrapper for the moment.
>
> Bill
More information about the pylucene-dev
mailing list