From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7953 invoked by alias); 28 Jun 2011 04:51:19 -0000 Received: (qmail 7927 invoked by uid 22791); 28 Jun 2011 04:51:18 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,SARE_HEAD_8BIT_SPAM,SARE_SUB_ENC_UTF8,TW_GC X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 28 Jun 2011 04:51:03 +0000 From: "licheng.1212 at gmail dot com" To: java-prs@gcc.gnu.org Subject: [Bug java/49556] New:=?UTF-8?Q?=20The=20import=20A=20cannot=20be=20resolved=EF=BC=8CBut=20the=20A=20is=20placed=20at=20the=20current=20dir?=. X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: java X-Bugzilla-Keywords: X-Bugzilla-Severity: blocker X-Bugzilla-Who: licheng.1212 at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Date: Tue, 28 Jun 2011 04:51:00 -0000 Mailing-List: contact java-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-prs-owner@gcc.gnu.org X-SW-Source: 2011-q2/txt/msg00098.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D49556 Summary: The import A cannot be resolved=EF=BC=8CBut the A is pl= aced at the current dir. Product: gcc Version: 4.4.2 Status: UNCONFIRMED Severity: blocker Priority: P3 Component: java AssignedTo: unassigned@gcc.gnu.org ReportedBy: licheng.1212@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=20 public final class A { public void a() { System.out.println("A print"); } } [lee@localhost test]$ cat Main.java=20 import A; class Main{ public static void main(String args[]) { A a=3Dnew A(); a.a(); } } [lee@localhost test]$ gcj --classpath=3D./ -c Main.java=20 Main.java:1: error: The import A cannot be resolved import A; ^ 1 problem (1 error) [lee@localhost test]$=20 But when I change the A to a package,then it's OK [lee@localhost test]$ tree =2E |-- Main.java `-- pakfile `-- A.java 1 directory, 2 files [lee@localhost test]$ cat pakfile/A.java=20 package pakfile; public final class A { public void a() { System.out.println("A print"); } } [lee@localhost test]$ cat Main.java=20 import pakfile.A; class Main{ public static void main(String args[]) { A a=3Dnew A(); a.a(); } } [lee@localhost test]$ gcj --classpath=3D./ -c Main.java=20 [lee@localhost test]$