- OpenJDK 11.0.2 설치(on centos 7)
# 다운로드
> cd /home/user1/java
> wget https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz
> tar xvfz openjdk-11.0.2_linux-x64_bin.tar.gz
# 환경변수 추가
> vi ~/.bashrc
export PATH=/home/user1/java/jdk-11.0.2/bin:$PATH
export JAVA_HOME=/home/user1/java/jdk-11.0.2
# 환경변수 적용
> source ~/.bashrc
# 확인
> java --version
- OpenJDK 8 설치 (on centos 7)
# 설치 가능 목록 확인
> yum list java-1.8.0-openjdk-devel*
java-1.8.0-openjdk-devel.i686 1:1.8.0.222.b10-0.el7_6 updates
java-1.8.0-openjdk-devel.x86_64 1:1.8.0.222.b10-0.el7_6 updates
java-1.8.0-openjdk-devel-debug.i686 1:1.8.0.222.b10-0.el7_6 updates
java-1.8.0-openjdk-devel-debug.x86_64 1:1.8.0.222.b10-0.el7_6 updates
[user1@localhost ~]$
# 설치
# java-1.8.0-openjdk 는 JRE, java-1.8.0-openjdk-devel은 JDK
> sudo yum -y install java-1.8.0-openjdk-devel.x86_64
환경변수 설정
> vi ~/.bashsrc
# Java
export PATH=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b10-0.el7_6.x86_64/bin:$PATH
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b10-0.el7_6.x86_64
> source ~/.bashsrc
- 옵션 참고 사항
-- networkaddress.cache.ttl (필요시)
https://docs.aws.amazon.com/ko_kr/sdk-for-java/v1/developer-guide/java-dg-jvm-ttl.html
-- java.security.egd (필요시)
- OpenJDK zulu 8 / 11 설치 (on ubuntu 18.04/20.04)
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0x219BD9C9
sudo apt-add-repository 'deb http://repos.azulsystems.com/ubuntu stable main'
sudo apt-get update
# openJDK zulu 11
sudo apt-get -y install zulu-11
# openJDK zulu 8
sudo apt-get -y install zulu-8
# 버전 선택
sudo update-alternatives --config java
'Java' 카테고리의 다른 글
[spring boot 2.1.7] thymelef 설정 (0) | 2019.08.29 |
---|---|
[spring boot 2.1.7] JSP 설정 (0) | 2019.08.29 |
[spring boot 2.1.7] profile 및 logback 설정 (0) | 2019.08.29 |
[spring boot 2.1.7] 개발 준비 (0) | 2019.08.29 |
CentOS 자바 설치 (0) | 2019.01.04 |
Java System.loadLibrary 로 native module 로드시 에러 (0) | 2017.11.17 |
[spring boot] websocket 예제 중 html 부분 (0) | 2017.10.18 |
클라이언트/서버 심플 (0) | 2012.06.21 |