Bug 19173 - problems resolving classes
Summary: problems resolving classes
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: 3.4.3
: P2 normal
Target Milestone: 4.3.0
Assignee: Not yet assigned to anyone
Keywords: rejects-valid
Depends on: 28067
  Show dependency treegraph
Reported: 2004-12-28 11:01 UTC by wolfgang haefelinger
Modified: 2007-01-09 20:46 UTC (History)
4 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:

original demo project for bug 19173 (360 bytes, application/octet-stream)
2004-12-28 11:05 UTC, wolfgang haefelinger

Note You need to log in before you can comment on or make changes to this bug.
Description wolfgang haefelinger 2004-12-28 11:01:31 UTC
GCJ appears to have a problem with statement 'import <package>.*' 
in  case  all  files  to  be  imporated are given as compilation 
arguments. The very same works fine using SUN's javac compiler.

{* Upps, how can I upload  something here? Anyway, the whole sub-
ject has been investigated by Tom (tromey@redhat.com) and a small
demo project has been sent. *}

Here's a literal description of the demo project: This
are the project files:

 $ tar zxvf xxx.tgz

This is the file's contents: 

================ hello.java =============================
package greeting;

import greeting.impl.*;

public class hello {
  static Echo myecho;
================ Echo.java ==============================
package greeting.impl;
public class Echo {}

Now I'm going to compile the whole package in one shot:

 $ cd xxx
 javac -d . -C hello.java impl/Echo.java   # ok

=>> Works fine!

Remove files created by 'javac':

 $ rm -rf greeting

Try to compile the very same using gcj:

 $ gcj -d . -C hello.java impl/Echo.java 
 hello.java:3: error: Can't find default package `greeting.impl'. \
 Check the CLASSPATH environment variable and the access to the archives
 1 error

The problem appears to be related to 

 import hello.impl.*;

in hello.java. When changing to read

 import hello.impl.Echo ;

compilation using gcj works fine. Another option is to 
rename directory "xxx" into "greeting" and to use -I ..,

 $ cd ..
 $ mv xxx greeting
 $ cd greeting
 $ gcj -d . -I .. -C hello.java impl/Echo.java
Comment 1 wolfgang haefelinger 2004-12-28 11:05:54 UTC
Created attachment 7835 [details]
original demo project for bug 19173

Ahh, here we go. The initial bug reporting page should mention that an
attachment might be added  a f t e r  having commited the bug report.
Comment 2 Phil Shaw 2005-03-29 11:36:11 UTC
This appears to be a duplicate of bug 10894.
Comment 3 wolfgang haefelinger 2005-03-29 14:12:19 UTC
(In reply to comment #2)
> This appears to be a duplicate of bug 10894.

I think you are correct - looks like I missed entry 19173. Nevertheless, I like
my entry because my entry is short, clear and precise. 

Will this bug ever be fixed?
Comment 4 Tom Tromey 2007-01-09 20:46:51 UTC
All gcj front end bugs have been fixed by the gcj-eclipse branch merge.
I'm mass-closing the affected PRs.
If you believe one of these was closed in error, please reopen it
with a note explaining why.