자바로 프로젝트를 만들어서 진행하다 보면 종종 현재 디렉토리(current working directory)가 어디인지 몰라서 고생하는 경우가 있다.
그럴 때는 아래 코드로 간단히 알아낼 수 있다.
void foo() {
System.out.println("Working Directory = " + System.getProperty("user.dir"));
System.out.println("Working Directory = " + new File(".").getAbsolutePath());
}
앗 이거 까먹고 있었는데 고맙습니당ㅋㅋ