Class file generated by "gcj -C" throws ClassFormatError

Tom Tromey tromey@redhat.com
Fri Jun 22 09:19:00 GMT 2001


>>>>> ">" == Weiqi Gao <weiqigao@yahoo.com> writes:

>> On Sparc/Solaris 2.6, 'gcj -C foo.java' generates a
>> foo.class file that throws ClassFormatError when run
>> with 'java foo':

>> // foo.java
>> class foo {
>>   static long x;
>>   public static void main(String[] args) {
>>     new foo();
>>   }
>> }


I didn't try this on Solaris.
I tried it on my x86 Linux box with JDK 1.2.2.
It worked fine.

I also looked at the generated bytecode, and it looks reasonable.
Could send the output of `jcf-dump -c foo'?
That will let us see if the problem is with gcj or with Sun's java.

Tom



More information about the Java mailing list