I tried refering to the class from the other package by its full name
(pack2.OtherPack) from MainPack and that worked fine.
So you have a point about the problem being the actual import statements.
Here is the source that fails on "import pack2":
src\pack1\pack1.java:
package pack1;
import pack2;
public class MainPack {
public static void main(String[] args) {
OtherPack op = new OtherPack();
op.print();
}
}
src\pack2\pack2.java:
package pack2;
public class OtherPack {
public void print(){
System.out.println("Hello");
}
}
----- Original Message -----
From: "Robert Klemme" <bob.news@gmx.net>
Newsgroups: comp.lang.java.softwaretools
Sent: Wednesday, March 30, 2005 11:44 AM
Subject: Re: Import problem
> > Hi all,
> > I am new to Eclipse and already have a problem with imports.
[quoted text clipped - 16 lines]
>
> robert
Ulf_N - 30 Mar 2005 22:22 GMT
Martin Kjeldsen skrev:
> I tried refering to the class from the other package by its full name
> (pack2.OtherPack) from MainPack and that worked fine.
[quoted text clipped - 53 lines]
>>
>> robert
You must import a type, not a package.
This should import all types (classes and interfaces) in pack2:
import pack2.*;
/ulf