1
Netbeans과 ImageIcons 같은 JAR 파일 모두에로드 할 수있는 리소스를 얻을 수 있었지만 현재는 동일한 디렉토리에서 "읽기"를 할 수 없습니다. JAR 파일의 프로그램 클래스 경로 디렉토리에 디렉토리와 파일을 나열하려고하지만 JAR 파일에서 프로그램을 실행하면 디렉토리를 읽을 수 없게됩니다. 그것은 Netbeans에서 잘 작동합니다. 넷빈즈에서 실행하면 Netbeans에서 읽을 수있는 디렉토리가 아닌 JAR 파일에서 실행
tileDirectory = new File(TileDirectoryLister.class.getResource("/resources/images/tiles").getPath());
jta.append("\nThe class path for the tile directory is:"
+ "\n\t" + tileDirectory.getPath());
jta.append("\nThe tile directory is readable: " + tileDirectory.canRead());
canRead
이 왜 false
으로 인쇄됩니까?