This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug java/49556] New: The import A cannot be resolvedïBut the A is placed at the current dir.
- From: "licheng.1212 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 28 Jun 2011 04:51:18 +0000
- Subject: [Bug java/49556] New: The import A cannot be resolvedïBut the A is placed at the current dir.
- Auto-submitted: auto-generated
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: 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
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]$