[pylucene-dev] classpath problem when compiling the trunk
Felix Schwarz
felix.schwarz at web.de
Sun Sep 23 05:52:45 PDT 2007
Hi,
after my success on CentOS 5, I tried to build PyLucene on Fedora 7.
Unfortunately, this does not work:
...
cd lucene-java-2.2.0-549438/build/contrib/snowball/classes/java; \
find . -name '*.class' -print | \
sed -e 's|^\./||' -e 's|/|.|g' -e 's|\.class$||' | \
xargs -n 1 /usr/bin/gcjh -d . --classpath=.
Exception in thread "main" java.io.IOException: can't find class file org/apache/lucene/analysis/Analyzer.class in java.net.URLClassLoader{urls=[file:/home/fs/rpmbuild/BUILD/PyLucene-svn338/lucene-java-2.2.0-549438/build/contrib/snowball/classes/java/./,file:/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre/lib/rt.jar], parent=gnu.gcj.runtime.SystemClassLoader{urls=[file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}}
at gnu.classpath.tools.javah.Main.getClass(libgcj-tools.so.8rh)
at gnu.classpath.tools.javah.ClassWrapper.linkSupers(libgcj-tools.so.8rh)
at gnu.classpath.tools.javah.ClassWrapper.printFully(libgcj-tools.so.8rh)
at gnu.classpath.tools.javah.CniIncludePrinter.printClass(libgcj-tools.so.8rh)
at gnu.classpath.tools.javah.Main.writeHeaders(libgcj-tools.so.8rh)
at gnu.classpath.tools.javah.Main.run(libgcj-tools.so.8rh)
at gnu.classpath.tools.javah.GcjhMain.main(libgcj-tools.so.8rh)
Exception in thread "main" java.io.IOException: can't find class file org/apache/lucene/analysis/TokenFilter.class in java.net.URLClassLoader{urls=[file:/home/fs/rpmbuild/BUILD/PyLucene-svn338/lucene-java-2.2.0-549438/build/contrib/snowball/classes/java/./,file:/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre/lib/rt.jar], parent=gnu.gcj.runtime.SystemClassLoader{urls=[file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}}
at gnu.classpath.tools.javah.Main.getClass(libgcj-tools.so.8rh)
at gnu.classpath.tools.javah.ClassWrapper.linkSupers(libgcj-tools.so.8rh)
at gnu.classpath.tools.javah.ClassWrapper.printFully(libgcj-tools.so.8rh)
at gnu.classpath.tools.javah.CniIncludePrinter.printClass(libgcj-tools.so.8rh)
at gnu.classpath.tools.javah.Main.writeHeaders(libgcj-tools.so.8rh)
at gnu.classpath.tools.javah.Main.run(libgcj-tools.so.8rh)
at gnu.classpath.tools.javah.GcjhMain.main(libgcj-tools.so.8rh)
make: *** [lucene-java-2.2.0-549438/build/contrib/snowball/lucene-snowball-2.2.0-549438.jar] Fehler 123
$ rpm -q gcc-java
gcc-java-4.1.2-12
The problematic part is the make target named "$(SNOWBALL_JAR): $(LUCENE_JAR)".
It seems to me as if this is a classpath problem because the class files are present.
If I change the Makefile so that an additional, absolute path item is used, the
compilation continues:
$(SNOWBALL_JAR): $(LUCENE_JAR)
cd $(LUCENE)/contrib/snowball; $(ANT) -Dversion=$(LUCENE_VER)
cd $(LUCENE)/build/contrib/snowball/classes/java; \
find . -name '*.class' -print | \
sed -e 's|^\./||' -e 's|/|.|g' -e 's|\.class$$||' | \
xargs -n 1 $(JCCH) -d . --classpath=/home/fs/rpmbuild/BUILD/PyLucene-svn338/$(LUCENE)/build/classes/java/:.
Several difficulties come to mind:
1. This modification needs to be done in several places.
2. The classpath separator is not consistent between platforms: Windows uses ";" (probably
because of drive letters), Linux ":".
Is there another workaround? Something wrong with my setup:
...
PYTHON_VER=2.5
DB_VER=4.5.20
...
PREFIX=/usr
PREFIX_PYTHON=$(PREFIX)
LIBDIR_NAME=lib64
GCJ_HOME=/usr
GCJ_LIBDIR=$(GCJ_HOME)/$(LIBDIR_NAME)
GCJ_STATIC=0
WCCFLAGS=-Wno-write-strings
ANT=ant
PYTHON=$(PREFIX_PYTHON)/bin/python
fs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3299 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.osafoundation.org/pipermail/pylucene-dev/attachments/20070923/3cbe2627/smime.bin
More information about the pylucene-dev
mailing list