Content

Board ID 334
Writer heojk
Write Date 2017-01-11 16:42:08
Subject java –version 명령을 실행시켰을 때 java version 1.7.0.xx로 보일 때
Content CentOS 6.7에 디폴트로 설치되는 java를 찾아 실행시키기 때문이다. update-alternatives 명령으로 확인해 보면 OpenJDK 1.7이 디폴트로 설정돼 있는 것을 확인할 수 있다. # update-alternatives --config java There are 2 programs which provide 'java'.   Selection    Command ----------------------------------------------- *+ 1           /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java    2           /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java Enter to keep the current selection[+], or type selection number:  # update-alternatives --install /usr/bin/java java /usr/local/jdk1.8.0_60/bin/java 3 # update-alternatives --config java There are 3 programs which provide 'java'.   Selection    Command ----------------------------------------------- *+ 1           /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java    2           /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java    3           /usr/local/jdk1.8.0_60/bin/java Enter to keep the current selection[+], or type selection number: 3 # java –version java version "1.8.0_45" Java(TM) SE Runtime Environment (build 1.8.0_45-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)