title: Netbeans 7: How to create Java project from existing source correctly?
body: <p>Starting with the following file structure:</p>
  <pre><code>doc/
  lib/
  src/%java-like structure%
  test/%java-like structure%
  build.xml
  </code></pre>
  <p>I want to create a new Netbeans project (inside this structure), using the existing</p>
  <ul>
  <li>build file</li>
  <li>sources</li>
  <li>libraries</li>
  <li>other files</li>
  </ul>
  <p>With the Netbeans guide to create a project from existing source I manage to import sources and test files, but then there are problems:</p>
  <ol>
  <li>You have to choose a name for a build file, when trying it with the existing build file Netbeans blocks</li>
  <li>After creating the project, Netbeans doesn't find the library packages in <code>.lib/</code> whether entering the folder under Properties/Libraries or not.</li>
  </ol>
  <p>As asked <a href="https://stackoverflow.com/questions/5801446/how-to-create-a-netbeans-7-project-from-an-existing-git-repo">here</a>, I want to create the project from a git repository, but the suggested solution doesn't work for me (git does not want to clone into a non-empty directory...) and I doubt this would help with the library problem etc.</p>
  <h3>EDIT 1</h3>
  <p>Somehow it works to create a new Netbeans project, then add libraries to it and import the packages of the libraries. But this doesn't work when creating a project from existing sources (then Netbeans doesn't find the packages)!</p>
  <h3>EDIT 2</h3>
  <p>It seems to be even more complicated: It also doesn't work when I create a new project, change the source folder to the directory where the sources are (from which I want to make a project of) and add the libraries. But using the libraries in a new project with new source works.</p>