I have the following setup in my project:
com.foo
- Main
com.foo.util
- StringUtil
In Main I import the StringUtil using
package com.foo;
import com.foo.util.StringUtil;
And use it just as you would use it;
StringUtil string = new StringUtil();
Yet, eclipse keeps telling me that StringUtil cannot be resolved to a type - how can this be?
I already tried refreshing the project, reimporting it as a new project, clicked through the build paths but everything seems to be set up correctly.
But still, eclipse doesn't recognize the class and won't compile my project.
EDIT: The original question had this format:
package com.foo;
import com.foo.StringUtil;
Thus my answer was:
Because StringUtil is in com.foo.util and not in com.foo.
Change it to import com.foo.util.StringUtil.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With