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/49556] New: The import A cannot be resolvedïBut the A is placed at the current dir.


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]$


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