0

In Intellij I added a class Geometry.class as library root file (via project-structure/modules/dependencies) and it totally worked out for my inheriting class Volume.java in the default package. Now after moving the Volume down into a package blatt03 it cant find Geometry anymore.

Do you guys know why thats the case? Normally the library shouldn't be available only to the default package, right?

I already tried Invalidate cache and restart.

picture of my IDE

elmigue017
  • 343
  • 2
  • 12
tbrodbeck
  • 460
  • 1
  • 8
  • 16

1 Answers1

0

This is more or less a duplicate of How to access java-classes in the default-package?

The core statement is You can’t use classes in the default package from a named package.

So the class Geometry.class must not be contained at root level (default package). Just put it in a package.

Community
  • 1
  • 1
guenhter
  • 11,255
  • 3
  • 35
  • 66
  • are you sure thats the same problem? Because I want to access .class files from the library. I just added a picture to my post to make it clearer – tbrodbeck May 13 '17 at 12:41
  • HI yes, this is the problem. So if you have control over the library containing the `Geometry`-class, move it into a package. If you don't have control over it, maybe the maintainer can move it. – guenhter May 14 '17 at 19:55