title: gen-class not generating a class
body: <p>I'm having difficulty referencing classes generated via <code>:gen-class</code>.</p>
  
  <p>The smallest example I can show that demonstrates the problem is:</p>
  
  <pre><code>(defproject test-proj
    :dependencies [[org.clojure/clojure "1.8.0"]] 
    :aot [test-proj.test])
  </code></pre>
  
  <hr>
  
  <pre><code>(ns test-proj.test
    (:gen-class))
  
  (defn -main []
    (println test_proj.test)) ; Error here
  </code></pre>
  
  <p>The problem is, this yields a <code>ClassNotFoundException</code> on the marked line.</p>
  
  <p>(I tried all different combinations of <code>-</code> and <code>_</code> in the above file and the <code>project.clj</code>. I still don't fully understand what requires an underscore and what tolerates a dash. Some things seem to roll with dashes and convert them as needed, whereas I know from messing around that in the <code>-main</code>, I need underscores to reference <code>test_proj.test</code>.)</p>
  
  <p>If I go into the project root file, there's no <code>target</code> folder, so it's not generating the class. If I go into the terminal and run <code>lein compile</code>, it generates the needed classes under <code>target</code>, and the above code runs without error. This is a poor workaround though. What if I modify the file and forget to manually recompile it? It's also a pain to have to manually compile it after any time I do a <code>clean</code>.</p>
  
  <p>As a shot in the dark, I tried using <code>compile</code> right underneath the <code>ns</code> macro:</p>
  
  <pre><code>(compile 'test-proj.test)
  </code></pre>
  
  <p>If I uses dashes, <code>compile</code> seems to do literally nothing. I may be misinterpreting its use, but it doesn't generate class files under <code>target</code>. If I use underscores, it gives an exception saying that the namespace isn't found.</p>
  
  <p>Is there a way to have the classes generated automatically so I don't need to run <code>lein compile</code> everytime? I thought that that's what the <code>:aot</code> in the <code>project.clj</code> did.</p>