본문 바로가기

Development Note/JAVA

이클립스(Eclipse) 'could not write file: ~.classpath' 에러(Error) 해결방법

이클립스(Eclipse) 'could not write file: ~.classpath' 에러(Error) 해결방법

[ENG] How to solve the problem: 'could not write file: ~.classpath'




 이전 포스트에서도 밝혔듯, 저는 맥 플랫폼에서 안드로이드 개발을 쭉 해 왔습니다. 이번에 안드로이드 프로젝트들을 윈도우 플랫폼으로 마이그레이션 하는 과정에서 몇 가지 이슈가 발생했는데요, import 과정에서 발생하는 다음과 같은 에러가 그 중 하나입니다.

[ENG] As I mentioned at last post, I am using Mac for Android development. Recently I tried to migrate every android projects to windows-based desktop. And there was few issues. Following is the one of those issues which has happened on Import process.


다음(following):

'could not write file: ~(path)/.classpath'


 몇 번을 임포트해도 같은 에러가 발생했습니다. 십 수 차례 시도하다가 구글링으로 답을 찾아냈습니다. 문제의 발생 원인은 맥(혹은 리눅스)에서 작성한 프로젝트를 윈도우에서 임포트할 경우에 발생하는 문제로, .classpath 파일과 .project 파일에 부여된 Attributes(특성) 때문에 발생하는 문제였습니다.

[ENG] I tried several times, but I couldn't solve it. So I googled and found why. It is the problem which is happening when trying to import projects that created on Mac(Linux). All I had to do is changing attributes of files.


     요점만 간단히 설명하면 이렇습니다. [ENG]Simply,

.classpath 파일과 .project 파일의 숨김 설정을 해제하고 프로젝트를 임포트하면 해결됩니다. 

[ENG]Release Hidden-Attribute of following two files of project: .classpath file and .project file.


더 자세한 설명은 아래에 이미지와 함께 단계별로 정리 해 두었습니다.

[ENG] And I described more detail steps in below.


 해결 방법은 다음과 같습니다. 프로젝트가 있는 폴더에 가서 도구(T) > 폴더 옵션(O) 을 선택합니다. 그럼 다음과 같은 창이 등장합니다.

[ENG] Go to the project file folder in explorer. And tap Alt and choose Tools(T) > Folder Options(O).




하이라이트된 옵션 '숨김 파일, 폴더 및 드라이브 표시' 항목을 체크하고 적용(A) 혹은 확인 버튼을 눌러줍니다. 여기까지 수행하면 프로젝트 폴더 내에 .classpath 파일과 .project 파일이 나타나게 됩니다.

[ENG] Select highlighted option on above(Show hidden files, folders, and drives) and save. Then you can find .classpath file and .procect file at your project folder.




두 파일의 파일 속성을 변경해 주어야 합니다. 둘 중 한 파일을 선택하고 마우스 오른쪽 버튼을 클릭하면 맨 아래에 속성(R) 이라는 메뉴가 있습니다.

[ENG] Next, You have to change Attribute of those files. Select one file and click right button of mouse. Then you will find 'Properties(R)' menu.




 붉은색으로 하이라이트 된 영역이 속성(R) 항목입니다. 클릭해줍니다. 그럼 다음과 같은 창이 등장합니다.

[ENG] Click it. Then next window will show up.




 사진의 하이라이트된 영역이 숨김(H) Attribute 입니다. 숨김(H) 체크박스를 해제하고 확인 버튼을 눌러 상태를 저장합니다. .classpath 파일과 .project 파일 모두의 숨김 체크박스를 해제해 줍니다.

[ENG] Highlighted area is Hidden(H) Attribute. Release checkbox and save. You have to do this to both of .classpath file and .project file.


 이제 프로젝트가 문제 없이 임포트 되는 것을 확인할 수 있습니다.

[ENG] Now you have solved the problem. There will be no problem on import.