title: Can't run the Java project in NetBeans
body: <p>When I try to run my java project in NetBeans with a Scanner in it, it doesn't run and shows error message in the output field.
  &quot;FAILURE: Build failed with an exception.(Scanner). processResources NO-SOURCE&quot;.</p>
  <p>When I delete <code>names[x] = s.next();</code> and <code>grades[x] = s.nextInt();</code> it runs.
  I looked for a solution a lot but non of them have worked for me.
  Note that I can run the same code in Android Studio.
  I'm a beginner in programming, anyone have an idea how to fix it??</p>
  <p>My code:</p>
  <pre><code>package codePracticing;
  public class Main {
      public static void main(String args[]) {
          
          
          java.util.Scanner s = new java.util.Scanner(System.in);
          
          String names[] = new String[5];
          int grades[] = new int[5];
          
          for (int x = 0; x &lt; names.length; x++){
              if (x != 3){
                  System.out.println(&quot;Enter Name Of Student Number&quot; + String.valueOf(x + 1) + &quot;: &quot;);
                  names[x] = s.next();
                  System.out.println(&quot;Enter Grade Of Student Number&quot; + String.valueOf(x + 1) + &quot;: &quot;);
                  grades[x] = s.nextInt();
              }
          }
  
          for (int x = 0; x &lt; names.length; x++){
              if (x != 3){
                  System.out.println(&quot;Student Number &quot; + String.valueOf(x + 1) + &quot; &quot; + names[x] + &quot; ; Grade: &quot; + grades[x]);
              }
          }
  </code></pre>
  <p>The error message in the Output tab:</p>
  <pre><code>JAVA_HOME=&quot;C:\Program Files\Java\jdk-16.0.2&quot;
  cd C:\Users\***\Documents\NetBeansProjects\codePracticing; .\gradlew.bat --configure-on-demand -x check run
  Configuration on demand is an incubating feature.
  &gt; Task :compileJava
  &gt; Task :processResources NO-SOURCE
  &gt; Task :classes
  
  &gt; Task :run FAILED
  Enter Name Of Student Number1: 
  Exception in thread &quot;main&quot; java.util.NoSuchElementException
      at java.base/java.util.Scanner.throwFor(Scanner.java:937)
      at java.base/java.util.Scanner.next(Scanner.java:1478)
      at codePracticing.Main.main(Main.java:28)
  
  FAILURE: Build failed with an exception.
  
  * What went wrong:
  Execution failed for task ':run'.
  &gt; Process 'command 'C:\Program Files\Java\jdk-16.0.2\bin\java.exe'' finished with non-zero exit value 1
  
  * Try:
  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
  
  * Get more help at https://help.gradle.org
  
  BUILD FAILED in 381ms
  2 actionable tasks: 2 executed
  </code></pre>
  <p>Thanks..</p>