title: How to resolve error of JSONParser()?
body: <p>I am trying to read from a json file using java. This is what I have so far:</p>
  
  <pre><code> import jdk.nashorn.internal.parser.JSONParser;
   import java.io.FileReader;
   import java.util.Objects;
  
   public static void main (String[] args){
        JSONParser parser = new JSONParser(); //Error : JSONParser() in  JSONParser cannot be applied to expected parameters ...        
          System.out.println("Reading JSON file ...");
          FileReader fileReader = new FileReader("data.json"); // *file not found exception!
          JSONObject json = (JSONObject) parser.parse(fileReader); //JSONParser cannot be applied to java.io.File.Reader
          String t1 = (String) json.get("time");
          System.out.println("Time: " + t1);
     }
  </code></pre>
  
  <p>I have the following errors in this section:</p>
  
  <pre><code>  Error:(14, 29) java: constructor JSONParser in class       jdk.nashorn.internal.parser.JSONParser cannot be applied to given types;
   required: java.lang.String,jdk.nashorn.internal.objects.Global,boolean
   found: no arguments
   reason: actual and formal argument lists differ in length
  </code></pre>
  
  <p>I have the file data.json in the directory but it cannot read it and giving me FileNotFoundException</p>
  
  <p>I found the following lines:</p>
  
  <pre><code>  import org.json.simple.JSONObject;
    import org.json.simple.parser.JSONParser;
  </code></pre>
  
  <p>it is giving me the following errors for these two as well:</p>
  
  <pre><code>Error:(2, 23) java: package org.json.simple does not exist
  Error:(3, 30) java: package org.json.simple.parser does not exist
  </code></pre>
  
  <p>I am using IntelliJ IDEA 14.1.4 . How can I solve these errors?</p>