title: How to resolve failed execution reading JSON file to get the first name and last name?
body: <p>I'm getting this error</p>
  <blockquote>
  <p>Execution failed for task ':Card.main()'. Process 'command 'C:/Program
  Files/Java/jdk-11.0.8/bin/java.exe'' finished with non-zero exit value
  1</p>
  <ul>
  <li>Try: Run with --info or --debug option to get more log output. Run with --scan to get full insights.</li>
  </ul>
  </blockquote>
  <pre><code>package people;
  
  import org.json.JSONArray;
  import org.json.JSONObject;
  import org.json.simple.parser.JSONParser;
  import org.json.simple.parser.ParseException;
  import java.io.BufferedReader;
  import java.io.FileNotFoundException;
  import java.io.FileReader;
  import java.io.IOException;
  
  public class people {
  
      public static void main (String[] args) throws IOException, ParseException
      {
          JSONParser parser = new JSONParser();
          JSONArray a = (JSONArray) parser.parse(new BufferedReader(new FileReader(&quot;/folder/persons.json&quot;)));
  
          for (Object o : a)
          {
              JSONObject person = (JSONObject) o;
              String name = (String) person.get(&quot;firstname&quot;);
              System.out.println(name);
              String number = (String) person.get(&quot;lastname&quot;);
              System.out.println(number);
          }
      }
  }
  </code></pre>
  <p>JSON file</p>
  <pre><code>[
    {
      &quot;firstname&quot;: &quot;Oscar&quot;,
      &quot;lastname&quot;: &quot;Thompson&quot;
    },
    {
      &quot;firstname&quot;: &quot;Raphael&quot;,
      &quot;lastname&quot;: &quot;Garcia&quot;
    },
    {
      &quot;firstname&quot;: &quot;Tom&quot;,
      &quot;lastname&quot;: &quot;Smith&quot;
    },
    {
      &quot;firstname&quot;: &quot;Richard&quot;,
      &quot;lastname&quot;: &quot;Parson&quot;
    }
  ]
  </code></pre>