c.c and IBM JDK?

88 views
Skip to first unread message

David Andrews

unread,
Sep 6, 2009, 8:13:07 AM9/6/09
to Clojure
Is there a known problem with the IBM JDK and clojure-contrib?

I first encountered errors when trying to load pprint under the 1.5
IBM JDK on a zSeries system:

JVMJZBL1023N Invoking clojure.main.main()...
JVMJZBL2010E Exception occurred invoking clojure.main.main()
JVMJZBL2007E Stack trace follows:
java.lang.ClassFormatError: (clojure/contrib/pprint/PrettyWriter)
field name is invalid at offset=0 (pprint.clj:6)

I thought it might be an issue with the 1.5 JDK (which is all I have
on my zSeries box), so I reproduced the problem with both the 1.5 and
1.6 level IBM JDKs under Linux x86. clojure-contrib simply won't
build with the IBM JDK in the system:

$ ant -Dclojure.jar=../clojure/clojure.jar
...
compile_classes:
[java] Compiling clojure.contrib.pprint.ColumnWriter to /home/dba/
src/clojure-contrib/classes
[java] java.lang.ClassFormatError: JVMCFRE114 field name is
invalid; class=clojure/contrib/pprint/ColumnWriter, offset=0
(ColumnWriter.clj:36)
...
compile_clojure:
[java] java.lang.ClassFormatError: JVMCFRE114 field name is
invalid; class=clojure/contrib/condition/Condition, offset=0
(condition.clj:14)

Any ideas how can I proceed? I'm stuck with the IBM JDK on the IBM
box.

triddell

unread,
Sep 6, 2009, 8:56:31 PM9/6/09
to Clojure
This is issue #104 (which was called #100 in the old system.)

http://www.assembla.com/spaces/clojure/tickets/104-GC-Issue-100--gen-class-creating-non-compliant-field-names-

A simple patch was originally suggested here:

http://groups.google.com/group/clojure/browse_thread/thread/e64719d716c29ce0

This patch fixed the issue for me on the IBM JDK. I'll submit a patch
this time.

David Andrews

unread,
Sep 7, 2009, 5:37:11 AM9/7/09
to Clojure

triddell wrote:
> This patch fixed the issue for me on the IBM JDK.

Sadly, not for me! (IBM 1.5.0) c/c/pprint/ColumnWriter still fails
with:
[java] java.lang.ClassFormatError: (clojure/contrib/pprint/
ColumnWriter) field name is invalid at offset=0 (ColumnWriter.clj:36)

... during contrib build with genclass.clj modified to use \$ in place
of \-

Michael Reid

unread,
Sep 7, 2009, 6:36:37 PM9/7/09
to clo...@googlegroups.com

I took another look at this. I believe the issue is that my original
change was a quick-fix and doesn't really handle all cases.

The issue that Dave is hitting seems to be occurring because of the
default prefix character of '-' for the genclass methods. If I change
the prefix character in clojure/contrib/pprint/ColumnWriter.clj to _
and change the corresponding defn-s, then it seems to accept the
class.

I went digging through genclass.clj to try and make this fix more
robust but I haven't been able to fully understand where this needs to
go yet. Still digging...

/mike.

Reply all
Reply to author
Forward
0 new messages