Obsidian/Recognition/Programing/Linux/Ubuntu/우분투 JAVA 설치.md

36 lines
631 B
Markdown
Raw Normal View History

2023-08-14 16:19:25 +00:00
```bash
# OpenJDK8 설치
sudo apt-get install openjdk-8-jdk
# 설치 확인
java -version
# javac 위치 확인
which javac
/usr/bin/javac
## 링크를 통해 실제 경로 확인
readlink -f /usr/bin/javac
/usr/lib/jvm/java-8-openjdk-arm64/bin/javac
# profile 수정
sudo nano /etc/profile
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-arm64
export PATH=$JAVA_HOME/bin:$PATH
export CLASS_PATH=$JAVA_HOME/lib:$CLASS_PATH
# profile 적용
source /etc/profile
# 재부팅
sudo reboot now
# 환경변수 확인
echo $JAVA_HOME
$JAVA_HOME/bin/javac -version
#java 11 추가 설치
sudo apt-get install openjdk-11-jdk
```