title: Java compiler error "package does not exist", although the IDE finds the class
body: <p>I am working on a java based project in IntelliJ IDEA, I assume I have an issue with my project setup...</p>
  
  <p>The project consists of the "modules" (maybe I miss use that feature?): </p>
  
  <ul>
  <li>a library meant to be the common base for the two following modules</li>
  <li>a spring boot based test application</li>
  <li>an android app</li>
  </ul>
  
  <p>I succeeded in getting the library to build, creating a <code>jar</code>. </p>
  
  <p>However I fail to build the spring application, I receive this error: </p>
  
  <pre><code>error: package org.XXXX.XXX.lib.config does not exist
  import org.XXXX.XXX.lib.config.Config;
  </code></pre>
  
  <p>where <code>org.XXXX.XXX.lib.config.Config</code> refers to a class in the library and <code>org.XXXX.XXX.lib.config</code> is defined as a package in that library. </p>
  
  <p>The funny thing: the parser succeeds, auto unclusion (Alt-Enter) succeeds in finding the class, creates the <code>import</code> statement, no errors or warnings are shown in the editor. So the code inspection is happy. But then at build time above error is thrown. </p>
  
  <p>To be able to use that library in the spring application I added the libraries source folders to the module implementing the spring application in IDEA's project settings. Also I added the created <code>jar</code> file <em>and</em> the library itself as a module dependency (which probably is all wrong...).</p>
  
  <p>This is my first non trivial, private java based project and I have to acknowledge that I am a but at a loss. I don't really know how to proceed, how to tackle down that issue. </p>
  
  <p>Anyone got a hint for me? </p>