title: Run javac compiled groovy code using java?
body: <p>I have a simple groovy file as follows: </p>
  
  <pre><code>class test2 {
      public static void main(String[] args) {
          println("In groovy!!");
      }
  }
  </code></pre>
  
  <p>My gradle task is compiling this into a test2 class file</p>
  
  <p>How do I run this file from prompt ?</p>
  
  <p><strong>java test2</strong>  (from the location of the test2.class file)
  causes a : Error: Could not find or load main class test2.class</p>
  
  <p>I assuming I need to add asm and groovy to the class path. However: 
  <strong>java -cp "groovy-all-2.3.6.jar;asm-all-3.3.1.jar"  test2</strong>
  also doesn't work (files are in correct locations).</p>