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]

Class file generated by "gcj -C" throws ClassFormatError


I wrote:
> 
> 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 was confused yesterday and copied the wrong file. 
The Java source that has the problem is

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

The error is thrown if x is initialized with '0'.  The
error is not thrown if x is initialized with '0L' or
not at all.


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



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


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