http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49556
Summary: The import A cannot be resolved,But the A is placed at the current dir. Product: gcc Version: 4.4.2 Status: UNCONFIRMED Severity: blocker Priority: P3 Component: java AssignedTo: unassig...@gcc.gnu.org ReportedBy: licheng.1...@gmail.com there is a test case: [lee@localhost test]$ pwd /home/lee/project/test [lee@localhost test]$ ls A.java Main.java [lee@localhost test]$ cat A.java public final class A { public void a() { System.out.println("A print"); } } [lee@localhost test]$ cat Main.java import A; class Main{ public static void main(String args[]) { A a=new A(); a.a(); } } [lee@localhost test]$ gcj --classpath=./ -c Main.java Main.java:1: error: The import A cannot be resolved import A; ^ 1 problem (1 error) [lee@localhost test]$ But when I change the A to a package,then it's OK [lee@localhost test]$ tree . |-- Main.java `-- pakfile `-- A.java 1 directory, 2 files [lee@localhost test]$ cat pakfile/A.java package pakfile; public final class A { public void a() { System.out.println("A print"); } } [lee@localhost test]$ cat Main.java import pakfile.A; class Main{ public static void main(String args[]) { A a=new A(); a.a(); } } [lee@localhost test]$ gcj --classpath=./ -c Main.java [lee@localhost test]$