Try the following code:

=== p/A.java ===
package p;

public class A {
        public static interface AI {
                public static final int n = 3;
        }
}
=== p/B.java ===
package p;
import p.A.*;

public class B {
        static int main(String[] args) {
                System.out.println(AI.n);
                return 0;
        }
}
======

Building this with gcj fails with the error:
./p/B.java:3: error: Can't find default package 'p.A'. Check the CLASSPATH
environment variable and the access to the archives

JDK 1.5 javac can compile the example. Also changing the import in B.java to

import p.A.AI;

makes it work with gcj, too.


-- 
           Summary: gcj cannot import inner classes using a wildcard import
           Product: gcc
           Version: 4.0.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: michele at focuseek dot com


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

Reply via email to