title: Java Simple Json unexpected Token END OF FILE
body: <p>I'm testing a servlet on my PC, but if I run it I get Unexpected Token end of File at line 24 which is "Object obj = parser.parse(new FileReader("C:\libs\data.json"));".</p>
  
  <pre><code>String id = request.getParameter("id");
      JSONParser parser = new JSONParser();
  
      FileWriter file;
      file = new FileWriter("C:\\libs\\data.json");
  
      try{
  
          Object obj = parser.parse(new FileReader("C:\\libs\\data.json"));
          JSONObject jsonObject = (JSONObject) obj;
          String cont = (String) jsonObject.get(id);
          System.out.println(cont);
          int downloads = Integer.parseInt(cont);
          ++downloads;
  
          jsonObject.put(id, downloads);
  
          file.write(jsonObject.toJSONString());
      }catch(Exception e){
          e.printStackTrace();
      }finally {
          file.flush();
          file.close();
      }
  </code></pre>