[arch-general] pdftk - almost build but died - need help figuring out if I can find a work-around
Guys, I need pdftk for a script I use that does fax processing. I ran into this problem 6-7 months ago, but still had another server with pdftk on it so it wasn't critical. Now, I need to solve it. Currently pdftk in AUR is out of date due to it a dependency of gcc-gcj requiring it to be built against gcc-4.3. The building gcc-4.3 and then gcc-gcj part of the pdftk build goes fine (takes forever, but goes fine). The build seems to crater on a java-lib issue. Here is the actual error with a few lines of context: patching file pdftk/Makefile.Base patching file java_libs/com/lowagie/text/pdf/PdfEncryption.java patching file java_libs/Makefile make -C ../java_libs make[1]: Entering directory `/home/david/arch/pkg/bld/pdftk/src/pdftk-1.41/java_libs' make -C "/home/david/arch/pkg/bld/pdftk/src/pdftk-1.41/java_libs/com/lowagie/text"; make[2]: Entering directory `/home/david/arch/pkg/bld/pdftk/src/pdftk-1.41/java_libs/com/lowagie/text' gcj -march=x86-64 -mtune=generic -O2 -pipe -w --encoding=UTF-8 --classpath="/usr/share/java/libgcj-4.3.jar:/home/david/arch/pkg/bld/pdftk/src/pdftk-1.41/java_libs" -c Anchor.java -o Anchor.o Exception in thread "main" java.lang.NoClassDefFoundError: org.eclipse.jdt.internal.compiler.batch.GCCMain at gnu.java.lang.MainThread.run(libgcj.so.9) Caused by: java.lang.ClassNotFoundException: org.eclipse.jdt.internal.compiler.batch.GCCMain not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:/usr/share/java/eclipse-ecj.jar], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}} at java.net.URLClassLoader.findClass(libgcj.so.9) at java.lang.ClassLoader.loadClass(libgcj.so.9) at java.lang.ClassLoader.loadClass(libgcj.so.9) at gnu.java.lang.MainThread.run(libgcj.so.9) make[2]: *** [Anchor.o] Error 1 make[2]: Leaving directory `/home/david/arch/pkg/bld/pdftk/src/pdftk-1.41/java_libs/com/lowagie/text' make[1]: *** [itext] Error 2 make[1]: Leaving directory `/home/david/arch/pkg/bld/pdftk/src/pdftk-1.41/java_libs' make: *** [java_libs] Error 2 The problem is I am no good at figuring out what this is telling me I need to do to fix it. I know there was an exception thrown in thread "main" java.lang.NoClassDefFoundError: ........ what I don't know is whether this is telling me there is a javalib version mismatch or something similar and whether this is something I might work around by loading/building some alternative java package, etc.. If you have any idea what is going on here, please pass along a pointer or two. If this is just one of those areas where I'm screwed and there isn't a way around it -- well knowing that would be helpful too. Thanks. -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com
Am oder ungefähr am Freitag, 12. März 2010, schrieb David C. Rankin:
Guys,
I need pdftk for a script I use that does fax processing. I ran into this problem 6-7 months ago, but still had another server with pdftk on it so it wasn't critical. Now, I need to solve it.
Hi David! I always liked to have pdftk around and one or two years ago built it from aur. But then at some point I uninstalled it and now I cannot build it again because I get the very same error you describe here.
Currently pdftk in AUR is out of date due to it a dependency of gcc-gcj requiring it to be built against gcc-4.3. The building gcc-4.3 and then gcc-gcj part of the pdftk build goes fine (takes forever, but goes fine). The build seems to crater on a java-lib issue. Here is the actual error with a few lines of context:
----------- 8< ------------- gcj -march=x86-64 -mtune=generic -O2 -pipe -w --encoding=UTF-8 --classpath="/usr/share/java/libgcj-4.3.jar:/home/david/arch/pkg/bld/pdftk/src/pdftk-1.41/java_libs" -c Anchor.java -o Anchor.o Exception in thread "main" java.lang.NoClassDefFoundError: org.eclipse.jdt.internal.compiler.batch.GCCMain
This exception means that gcj was looking for a class named org.eclipse.jdt.internal.compiler.batch.GCCMain and could not find it in the class path.
at gnu.java.lang.MainThread.run(libgcj.so.9) Caused by: java.lang.ClassNotFoundException: org.eclipse.jdt.internal.compiler.batch.GCCMain not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:/usr/share/java/eclipse-ecj.jar], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
This part explains a little more details about what the classpath was gcj looked in. It seems that the only file in the classpath at this point is /usr/share/java/eclipse-ecj.jar which is consistent with the call of gcj above (notice the --classpath argument). If you look into eclipse-ecj.jar you find that it contains a class named org.eclipse.jdt.internal.compiler.batch.Main and thus I think that this class was renamed at some point after gcj 4.3 was released. So it seems that this is indeed a java library issue. I did another test and tried to run gcj on a simple Hello-World java file and it failed with the same exception. So it seems not to be a problem with the pdftk build process but rather that the old gcj does not work anymore with the current eclipse-ecj package. I then looked at the current gcc PKGBUILD and thought I could compile it with java support but failed because I don’t really understand the gcc PKGBUILD (which is rather complex I think).
----------------- 8< --------------------- The problem is I am no good at figuring out what this is telling me I need to do to fix it. I know there was an exception thrown in thread "main" java.lang.NoClassDefFoundError: ........ what I don't know is whether this is telling me there is a javalib version mismatch or something similar and whether this is something I might work around by loading/building some alternative java package, etc.. If you have any idea what is going on here, please pass along a pointer or two. If this is just one of those areas where I'm screwed and there isn't a way around it -- well knowing that would be helpful too. Thanks.
If you find out anything more or even get pdftk to build again I would really like to know how to do that! :) Good luck! Edgar
On 03/14/2010 10:37 AM, Edgar Kalkowski wrote:
Am oder ungefähr am Freitag, 12. März 2010, schrieb David C. Rankin:
Guys,
I need pdftk for a script I use that does fax processing. I ran into this problem 6-7 months ago, but still had another server with pdftk on it so it wasn't critical. Now, I need to solve it.
Hi David!
I always liked to have pdftk around and one or two years ago built it from aur. But then at some point I uninstalled it and now I cannot build it again because I get the very same error you describe here.
Currently pdftk in AUR is out of date due to it a dependency of gcc-gcj requiring it to be built against gcc-4.3. The building gcc-4.3 and then gcc-gcj part of the pdftk build goes fine (takes forever, but goes fine). The build seems to crater on a java-lib issue. Here is the actual error with a few lines of context:
----------- 8< ------------- gcj -march=x86-64 -mtune=generic -O2 -pipe -w --encoding=UTF-8 --classpath="/usr/share/java/libgcj-4.3.jar:/home/david/arch/pkg/bld/pdftk/src/pdftk-1.41/java_libs" -c Anchor.java -o Anchor.o Exception in thread "main" java.lang.NoClassDefFoundError: org.eclipse.jdt.internal.compiler.batch.GCCMain
This exception means that gcj was looking for a class named org.eclipse.jdt.internal.compiler.batch.GCCMain and could not find it in the class path.
at gnu.java.lang.MainThread.run(libgcj.so.9) Caused by: java.lang.ClassNotFoundException: org.eclipse.jdt.internal.compiler.batch.GCCMain not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:/usr/share/java/eclipse-ecj.jar], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
This part explains a little more details about what the classpath was gcj looked in. It seems that the only file in the classpath at this point is /usr/share/java/eclipse-ecj.jar which is consistent with the call of gcj above (notice the --classpath argument).
If you look into eclipse-ecj.jar you find that it contains a class named org.eclipse.jdt.internal.compiler.batch.Main and thus I think that this class was renamed at some point after gcj 4.3 was released. So it seems that this is indeed a java library issue.
I did another test and tried to run gcj on a simple Hello-World java file and it failed with the same exception. So it seems not to be a problem with the pdftk build process but rather that the old gcj does not work anymore with the current eclipse-ecj package.
I then looked at the current gcc PKGBUILD and thought I could compile it with java support but failed because I don’t really understand the gcc PKGBUILD (which is rather complex I think).
----------------- 8< --------------------- The problem is I am no good at figuring out what this is telling me I need to do to fix it. I know there was an exception thrown in thread "main" java.lang.NoClassDefFoundError: ........ what I don't know is whether this is telling me there is a javalib version mismatch or something similar and whether this is something I might work around by loading/building some alternative java package, etc.. If you have any idea what is going on here, please pass along a pointer or two. If this is just one of those areas where I'm screwed and there isn't a way around it -- well knowing that would be helpful too. Thanks.
If you find out anything more or even get pdftk to build again I would really like to know how to do that! :)
Good luck!
Edgar
Edgar, Thank you for the excellent explanation! I guess it will be up to the maintainer or another arch dev to see if this package can be fixed to compile against the current java and gcc. I'll drop a note in the AUR page letting the maintainer know, but this has been out of date so long, I'm not sure what response we will get. I'll keep you posted if I can snatch victory from the jaws of defeat. -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com
On 03/15/2010 01:06 AM, David C. Rankin wrote:
On 03/14/2010 10:37 AM, Edgar Kalkowski wrote:
Am oder ungefähr am Freitag, 12. März 2010, schrieb David C. Rankin:
Guys,
I need pdftk for a script I use that does fax processing. I ran into this problem 6-7 months ago, but still had another server with pdftk on it so it wasn't critical. Now, I need to solve it.
Just a FYI, looks like fedora has pdftk with a gcc44 patch: http://cvs.fedoraproject.org/viewvc/rpms/pdftk/F-13/ I'll also drop a note at AUR -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com
Am oder ungefähr am Montag, 15. März 2010, schrieb David C. Rankin:
On 03/15/2010 01:06 AM, David C. Rankin wrote:
On 03/14/2010 10:37 AM, Edgar Kalkowski wrote:
Am oder ungefähr am Freitag, 12. März 2010, schrieb David C. Rankin:
Guys,
I need pdftk for a script I use that does fax processing. I ran into this problem 6-7 months ago, but still had another server with pdftk on it so it wasn't critical. Now, I need to solve it.
Just a FYI, looks like fedora has pdftk with a gcc44 patch:
That looks interesting. But wouldn’t that require gcc 4.4 to be build with Java support? BEcause I tried that and sadly couldn’t get it working because of my lack of understanding the PKGBUILD … :(
On 03/17/2010 10:16 AM, Edgar Kalkowski wrote:
Just a FYI, looks like fedora has pdftk with a gcc44 patch:
That looks interesting. But wouldn’t that require gcc 4.4 to be build with Java support? BEcause I tried that and sadly couldn’t get it working because of my lack of understanding the PKGBUILD … :(
Don't feel bad, I didn't even make it that for because of my lack of knowledge of incorporating foreign patches and editing Makefiles :p Maybe somebody with the requisite knowledge can jump in here and lend us a hand. Who knows, maybe even the package maintainer can lend a hand since the package is now a year out of date? -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com
participants (2)
-
David C. Rankin
-
Edgar Kalkowski