문서의 이전 판입니다!
/etc/hosts에 127.0.0.1 localhost 존재시 올바른 hostname이 아닌 무조건 localhost 리턴/etc/hosts is 127.0.0.1 localhost localhost.localdomain centos57, then Java8 returns localhost for getHostName().127.0.0.1 centos57 localhost.localdomain localhost then getHostName() returns centos57.Java 8의 버그라기보다는 기존 Java 7의 행위가 버그였고 그것을 고친게 현 상태인 것으로 보임.
java 8은/etc/nsswitch.conf의 설정을 철저히 따르고 그 설정이 local machine의 /etc/hosts 파일을 우선시하기
때문에 나타나는 현상. 따라서 nsswitch.conf의 설정을 변경해야 한다.