I have two two projects, let's call them project A and B. Project A uses Project B as a library-project and project B has a "library.jar". This library is not exported by project B. However a third party library used by Project A can use the "library.jar" from project B.
How is this possible?
If I create a class in Project A which tries to reference this exact library it can't import this library, but an imported library can?
It definitely is using that library, because if I remove the library from Project Bs buildpath it won't work for the library in project A either.
Exported means API, not exported means internal:
The term exported comes from OSGi/Plug-in development (see Eclipse help: Plug-in Runtime) and refers to visibility: exported build class entries are visible in projects that have that project in the build path. Not exported build path entries are in upstream projects part of the build path, but are not visible (can not be referenced in the source code).
Eclipse has its own compiler that supports modularization at compile time (developed for OSGi but offered in a simpler way via required projects and export flags also for plain Java). If you do not use OSGi you will only have a flat build path without modularization at runtime.