json 파서를 사용하여 json 파일을 읽는 방법을 이해하려는 간단한 응용 프로그램과 작업을하고 있습니다. 나는 간단한 json 파일을 작성하고 그것을 나의 디렉토리 중 하나에 넣었다. 그럼 난 경로를 얻을 오른쪽 시계를 사용하고, 다음 코드를 작성 : json 파일 FileNotFoundException에서 읽기
java.io.FileNotFoundException: C:\Users\My Name\IntelliJIDEAProjects\Intereview\app\src\main\res\Data\dataStructures.json: open failed: ENOENT (No such file or directory)
가 무엇을 그 뒤에 이유가 될 수있다 : 어떤 이유에서
public void myParser() {
JSONParser parser = new JSONParser();
String path = "C:\\Users\\My Name\\IntelliJIDEAProjects\\Intereview\\app\\src\\main\\res\\Data\\dataStructures.json";
try{
JSONArray topics = (JSONArray)parser.parse(new FileReader(path));
for(int i=0;i<topics.length();i++) {
JSONObject object = topics.getJSONObject(i);
String title = object.optString("title").toString();
Log.i(TAG,title);
}
}
catch(JSONException e) {
Log.e("Internal Problem", e.getMessage());
} catch (ParseException e) {
e.printStackTrace();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
을 응용 프로그램을 실행할 때, 나는이 오류 ?
의 맞춤법 검사 ... 난 지난 몇 시간 동안이 작업을 봤는데 난 그냥 .. 그것을 알아낼 감사
나는 메시지가 꽤 분명하다고 생각합니다. Mybe는 여기 타입 : Intereview? – Jens
전화 또는 에뮬레이터에서 응용 프로그램을 실행하고 컴퓨터 디스크의 경로를 지정하면 어떻게 가능합니까? – Shubham
친구가 아니라 앱의 이름입니다.오타가 의도적입니다. – baki1995