Я пытаюсь прочитать мой JSON файл (размер: 255Mo ) в формате вот так:
{
"Data":[
{
"IDJointure": "001",
"societe": "societe1",
"heure": "04"
},
...
]
}
Вот мой код Java:
JSONParser jsonParser = new JSONParser();
Object object = jsonParser.parse(new FileReader("Data2019.json"));
JSONObject jsonObject=(JSONObject) object;
JSONArray arr = (JSONArray) jsonObject.get("Data");
for (int index = 0; index < arr.size(); index++) {
JSONObject jobj = (JSONObject) arr.get(index);
String IDJointure = (String) jobj.get("IDJointure");
System.out.println(IDJointure);
String societe = (String) jobj.get("societe");
System.out.println(societe);
}
Но у меня была эта ошибка:
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.5.0:exec (default-cli) on project Instanciation1: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Причина проблемы по размеру файла JSON?