Closed nguyendinhthuan789 closed 6 years ago
Hi all: mình làm 1 method read json ntn: public JSONObject parseContent(String dir) throws Exception { File file = new File(System.getProperty("user.dir") + dir); String content = FileUtils.readFileToString(file, "utf-8"); return new JSONObject(content); }
xong qua main gọi: public static void main(String[] args) { try{ JsonRead read=new JsonRead(); read.parseContent("lib/abc.json"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } }
Error path.. mọi người help cs ạ Thanks
bạn có thể cho mình xem cấu trúc thư mục và full log error được không, như vậy sẽ dễ dàng tìm bug hơn
@Thank @caodangtinh mình sửa dc rùi. mình parse nhưng chưa in!
Hi all: mình làm 1 method read json ntn: public JSONObject parseContent(String dir) throws Exception { File file = new File(System.getProperty("user.dir") + dir); String content = FileUtils.readFileToString(file, "utf-8"); return new JSONObject(content); }
xong qua main gọi: public static void main(String[] args) { try{ JsonRead read=new JsonRead(); read.parseContent("lib/abc.json"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } }
Error path.. mọi người help cs ạ Thanks