1

UPDATE question:

Thanks Favoretti!

I installed jcc using apt-get and the makefile under pylucene ran a little bit and threw a java error and I dont have a clue. Here it is. Can you please let me know what error it is?

While loading org/apache/pylucene/search/PythonIntParser
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/lib/python2.7/dist-packages/jcc/__main__.py", line 98, in <module>
    cpp.jcc(sys.argv)
  File "/usr/lib/python2.7/dist-packages/jcc/cpp.py", line 549, in jcc
    cls = findClass(className.replace('.', '/'))
  File "/usr/lib/python2.7/dist-packages/jcc/cpp.py", line 73, in findClass
    cls = _findClass(className)
jcc.cpp.JavaError: java.lang.UnsupportedClassVersionError: org/apache/pylucene/search/PythonIntParser : Unsupported major.minor version 51.0
Java stacktrace:
java.lang.UnsupportedClassVersionError: org/apache/pylucene/search/PythonIntParser : Unsupported major.minor version 51.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:266)

make: *** [compile] Error 255
Zenvega
  • 1,974
  • 9
  • 28
  • 45
  • If you try to locate or find your jcc installation where did it get installed? My hunch tells me under /usr/local/share/pyshared, where python IIRC doesn't look by default. – favoretti Nov 30 '11 at 01:21
  • when I compiled JCC, it copied a bunch of file to '/usr/local/lib/python2.7/site-packages/jcc'. How can I verify if jcc was properly installed? I typed jcc in the command prompt and it gave me an error that "No command 'jcc' found, but there are 16 similar ones jcc: command not found" – Zenvega Nov 30 '11 at 01:42

2 Answers2

2

If your python is in /usr/bin/python, i.e. system python and came from your distribution-supplied package - it probably doesn't look in /usr/local/lib/python2.7/site-packages/jcc by default.

What you can try is set PYTHONPATH environment variable to /usr/lib/python2.7:/usr/local/lib/python2.7 and try compiling like that, otherwise just move the jcc package to /usr/lib/python2.7.

This is assuming that your python installation came out of system default package and it's "home" location is /usr/lib/python2.7.

Hope this helps.

favoretti
  • 29,299
  • 4
  • 48
  • 61
  • thanks Favoretti! I have updated my question. Please help if you can. – Zenvega Nov 30 '11 at 03:04
  • @Pradeep: Sorry man, this is something PyLucene specific. First issue was environmental, that I could somehow guess :) This I'll leave to people who know something about the product. – favoretti Nov 30 '11 at 03:06
0

After following the suggestions by favoretti and pradeep , if you are still facing the issue please try the following:

  1. I would recommend downloading jcc and reinstalling as detailed at http://lucene.apache.org/pylucene/jcc/install.html When installing jcc , please open setup.py in jcc sources and confirm that variable 'linux2' points to the version of you would like to use e.g 'linux2' : '/usr/lib/jvm/java-7-oracle' Or in your case , would refer to the openjdk.

  2. enter pylucene source folder. confirm that "PREFIX_PYTHON" should match which python.

  3. Do a 'make clean' in pylucene sources . This should get rid of stale class files from earlier builds and rebuild with 'make'. This worked for me .

Regards sachin

user3283069
  • 355
  • 1
  • 6