java 설정을 위해 jdk 를 설치해야 하는데
sudo yum update 시
[Errno 14] curl#7 - "Failed to connect to ....: Network is unreachable"
와 같은 에러가 출력되며 yum 명령어를 정상적으로 사용할 수 없을 경우
(위의 에러를 해결하지 못하는 상황일 경우)
yum 다운로드가 아닌 파일로 jdk를 받아 설치하면 된다.
오라클 java 다운로드 페이지 접속
jdk 11 을 다운받기 위해
jdk-11.0.2_linux-x64_bin.tar.gz 다운로드 후
centos에 업로드
(홈디렉터리 하위에 업로드 하고 압축풀어주었다.)
1. tar.gz 파일 압축풀기 (tar -zxvf 파일명)
tar -zxvf jdk-11.0.2_linux-x64_bin.tar.gz
-> 홈 디렉터리 하위에
jdk-11.0.2
라는 이름으로 압축 풀림. 해당 이름으로 디렉터리 생성.
2. 환경변수설정 (사용자 계정 홈디렉터리 하위의 .bash_profile 편집)
ex)
$ vi /home/sd/.bash_profile
기존)
PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PATH
변경)
export JAVA_HOME=/home/sd/jdk-11.0.2
PATH=$JAVA_HOME/bin:$PATH:$HOME/.local/bin:$HOME/bin
export PATH
-->path에 $JAVA_HOME/bin:를 추가해줬다.
(뒤에 :$JAVA_HOME/bin 형태로 추가해도됨)
이후 적용
source /home/sdi/.bash_profile
확인
java -version/javac -version
-->
java version "11.0.2" 2019-01-15 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode)
적용완료.
'Server, OS > 리눅스' 카테고리의 다른 글
파일 시스템의 사용 가능 공간 표시 (df -k) (0) | 2022.11.15 |
---|---|
[centos7] 리눅스 오라클 12c 설치, 접속 및 db 연결 (0) | 2022.09.15 |
[centos7] 리눅스 계정 생성 (0) | 2022.09.15 |
[linux] 하위 디렉터리 포함 디렉터리 삭제 (0) | 2022.07.20 |
error) Port 8080 was already in use (0) | 2022.06.10 |