This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug java/12857] New: Illegal method modifier when loading a generated .class


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12857

           Summary: Illegal method modifier when loading a generated .class
           Product: gcc
           Version: 3.2.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: yves dot martin at elca dot ch
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: Linux
GCC target triplet: Java bytecode .class

I cannot describe why the .class is wrong - but I have extracted a simple test
case from a huge Java project:

public interface TestInterface {
  public static final String CONST = "My Class = " + 
      TestInterface.class.getName();
  public void aMethod();
}

public class TestCode implements TestInterface {
  public void aMethod() {
    return;
  }
  public static void main(String[] args) {
    System.out.println("Hello " + CONST);
  }
}

  gcj -C TestInterface.java
  gcj -C TestCode.java
  java -cp . TestCode
  The generated TestInterface.class is not loadable in Sun JVM:

Exception in thread "main" java.lang.ClassFormatError: TestInterface (Illegal
method modifiers: 0x8)
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)


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