This is the mail archive of the
java-discuss@sourceware.cygnus.com
mailing list for the Java project.
Re: Compiler errors while parsing bytecode files.
- To: Andrew Haley <aph at pasanda dot cygnus dot co dot uk>
- Subject: Re: Compiler errors while parsing bytecode files.
- From: Bryce McKinlay <bryce at albatross dot co dot nz>
- Date: Tue, 28 Sep 1999 11:45:10 +1200
- CC: GChambers at provsol dot com, java-discuss at sourceware dot cygnus dot com
- References: <19990927182058.11108.qmail@pasanda.cygnus.co.uk>
Andrew Haley wrote:
> > From: Glenn Chambers <GChambers@provsol.com>
> > Date: Mon, 27 Sep 1999 13:26:37 -0400
> >
> > I get the following error messages while attempting to compile the
> > Rhino javascript interpreter with the current CVS tip.
> >
> > The source code has a bunch of 1.1-isms in it, so a source compile
> > isn't currently possible.
> >
> > What's my next step?
>
> Firstly, what bytecode compiler are you using? It might be that it's
> generating illegal bytecode.
As a general warning, I've noticed several cases where bytecode produced
by Jikes will not compile with gcj, while bytecode produced by javac or
"gcj -C" from exactly the same source works fine. The jikes-generated
bytecode does, however, seem to work fine in the JDK VM.
Here's an example:
public interface A
{
public void a();
}
public interface B extends A
{
public void b();
}
public class Test implements B
{
public static void main(String args[])
{
Test t = new Test();
B a = (B) t;
a.a();
}
public void a()
{
System.out.println("A");
}
public void b()
{
System.out.println("B");
}
}
[bryce@reason abstract]$ jikes *.java
[bryce@reason abstract]$ java Test
A
[bryce@reason abstract]$ gcj *.class -o test --main=Test
Test.java: In class `Test':
Test.java: In method `main(java.lang.String[])':
Test.java:7: Class 'B' has no method named 'a' matching signature '()V'
gcj: Internal compiler error: program jc1 got fatal signal 11
[bryce@reason abstract]$ javac *.java
[bryce@reason abstract]$ gcj *.class -o test --main=Test
[bryce@reason abstract]$ ./test
A
I'm using jikes Version 0.55 (28 Jul 99).
regards
[ bryce ]