에 자바에서 파일을 열면 아래의 코드 스 니펫은이 오류가 발생합니다은 OS/X
File dir = new File(path);
String[] chld = dir.list();
if(chld == null){
System.out.println("Specified directory does not exist or is not a directory.");
System.exit(0);
} else {
for(int i = 0; i < chld.length; i++){
String fileName = chld[i];
System.out.println(fileName);
}
}
:이 코드로 나열된 파일을 볼 수 있기 때문에
Exception in thread "main" java.lang.Error: Unresolved compilation problem: Unhandled exception type FileNotFoundException
String path = "/Users/jfaig/Documents/workspace/my_array/";
BufferedReader in = new BufferedReader(new FileReader(path + "Matrix.txt"));
경로는 유효합니다
Java에서 OS/X 경로에 대한 많은 기사를 검토했지만 아무도 내 문제를 해결하지 못했습니다. Windows PC에서이 문제를 OS/X 및/또는 Eclipse 설치와 관련이 있는지 확인하려고합니다.