public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
From: "licheng.1212 at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: java-prs@gcc.gnu.org
Subject: [Bug java/49556] New: The import A cannot be resolved,But the A is placed at the current dir.
Date: Tue, 28 Jun 2011 04:51:00 -0000	[thread overview]
Message-ID: <bug-49556-8172@http.gcc.gnu.org/bugzilla/> (raw)

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


             reply	other threads:[~2011-06-28  4:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-28  4:51 licheng.1212 at gmail dot com [this message]
2011-06-28  6:09 ` [Bug java/49556] " pinskia at gcc dot gnu.org
2011-06-28 16:25 ` licheng.1212 at gmail dot com
2011-08-23 12:18 ` licheng.1212 at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-49556-8172@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=java-prs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).