This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Class file generated by "gcj -C" throws ClassFormatError


Tom Tromey wrote:
> 
> >>>>> ">" == Weiqi Gao <weiqigao@yahoo.com> writes:
> >>
> >> // foo.java
> >> class foo {
> >>   static long x;
> >>   public static void main(String[] args) {
> >>     new foo();
> >>   }
> >> }

I posted the good file rather than the bad file :( . 
The one that causes the error has an initializer for
x.

> 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.

I have attached jcf-dump's for the two classes
generated from:

class foo {
  static long x = 255;
  public static void main(String[] args) {
  }
}

and

class bar {
  static long x = 255L;
  public static void main(String[] args) {
  }
}

foo is the bad one, bar is the good one.  I have also
included the stacktrace of running 'java foo' with JDK
1.2.2 on Solaris.  I get the same stack trace if I
copy foo.class to a NT box and run it with JDK 1.3.

=====
Weiqi Gao
weiqigao@yahoo.com



__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

bar.jcf-dump

foo.jcf-dump

foo.stack-trace


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]