문서의 이전 판입니다!
java_base_version="8" java_sub_version="161" java_base_build="12" # 다운로드 링크를 보면 URL에 나옴 java_version="${java_base_version}u${java_sub_version}" java_build="b${java_base_build}" java_version_with_build="${java_version}-${java_build}" # download wget --no-cookies --header "Cookie: gpw_e24=xxx; oraclelicense=accept-securebackup-cookie;" "http://download.oracle.com/otn-pub/java/jdk/${java_version_with_build}/jdk-${java_version}-linux-x64.rpm" wget --no-cookies --no-check-certificate --header “Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie” "http://download.oracle.com/otn-pub/java/jdk/${java_version_with_build}/jdk-${java_version}-linux-x64.rpm" # install sudo rpm -i jdk-${java_version}-linux-x64.rpm # alternatives 등록 sudo /usr/sbin/alternatives --install /usr/bin/java java /usr/java/jdk1.${java_base_version}.0_${java_sub_version}/bin/java 20000 # set as default 화면에서 선택 sudo /usr/sbin/alternatives --config java # 확인 java -version # .bashrc 혹은 .bash_profile 에 환경변수 등록 export JAVA_HOME=/usr/java/default