title: Is it possible to combine java and groovy sources in the gradle project?
body: <p>I have the following project structure:</p>
  
  <pre><code>src
  |
  |--main
      |
      |--java
      |    |
      |    |--p
      |       |--S.java
      |  
      |
      |--groovy
           |
           |--p
              |--Main.groovy
  </code></pre>
  
  <p>the thing I want learn is how to combine java and groovy compiled classes together. Imagine that <code>S.java</code> contains the following:</p>
  
  <pre><code>package p;
  
  public class S {
      public static void p() {
          System.out.println("p");
      }
  }
  </code></pre>
  
  <p>and Main.groovy:</p>
  
  <pre><code>package p
  
  public class Main {
      public static void main(String[] args) {
          S.p
      }
  }
  </code></pre>
  
  <p>Now, the build script I've written is the simplest and contains merely</p>
  
  <pre><code>apply plugin : 'groovy'
  </code></pre>
  
  <p>What I want to achieve by the command <code>build gradle</code> is to get a <code>jar</code> file to using with JVM. But instead I got the following error:</p>
  
  <pre><code>Cannot infer Groovy class path because no Groovy Jar was found on class path: co
  nfiguration ':compile'
  </code></pre>
  
  <p>Could you possibly help me to fix that error?</p>