title: VSCode + Gradle Java Run and Debug
body: <p>I'm trying to make VSCode work with using a Gradle build file using Java with modules (from Java version 11). The gradle.build compile works just fine, but I cannot make VSCode execute the output compiled Java class files. (It always tries to create its own.)</p>
  <p>VSCode version: 1.48.2</p>
  <p>System Info: Ubuntu 2020.04</p>
  <p>Java Build:</p>
  <pre><code>openjdk 11.0.8 2020-07-14
  OpenJDK Runtime Environment (build 11.0.8+10-post-Ubuntu-0ubuntu120.04)
  OpenJDK 64-Bit Server VM (build 11.0.8+10-post-Ubuntu-0ubuntu120.04, mixed mode, sharing)
  </code></pre>
  <p>build.gradle file:</p>
  <pre><code>apply plugin: 'java'
  def version = 0.1
  
  sourceSets {
      main {
          java {
              srcDir 'src/easytext/javamodularity/easytext'
          }
      }
  }
  
  </code></pre>
  <p>module-info.java located at $projectDir/src/easytext/module-info.java</p>
  <pre><code>// module easytext {
  module easytext.javamodularity.easytext {
      requires java.base;
  }
  
  </code></pre>
  <p>Really simple Main.java, located at $projectDir/src/easytext/javamodularity/easytext/Main.java:</p>
  <pre><code>//package easytext;
  package easytext.javamodularity.easytext;
  
  import java.io.IOException;
  
  public class Main {
      public static void main(String[] args) throws IOException {
          if (args.length == 0) {
              System.out.println(&quot;Welcome to EasyText. Please provide a filename as input argument.&quot;);
              return;
          }
  
  }
  
  </code></pre>
  <p>The gradle file always wants to output to <strong>$projectDir/build/</strong>, but VScode always wants to run the files in $projectDir/bin/easytext/javamodularity/easytext/Main.class.</p>
  <p>I am also getting the VSCode error which I do not understand: &quot;module-info.java is not on the classpath of project EasyText, only syntax errors are reported.&quot;</p>
  <p>Running the Gradle task 'build' does compile successfully.</p>
  <p>I do not have a launch.json file because I am a loss for how to point it to the modulePath? Or is there some sort of magic I'm missing?</p>