Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(posts): create 2024-08-27-openjdk-17-install-ubuntu #511

Merged
merged 1 commit into from
Aug 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions _posts/linux/2024-08-27-openjdk-17-install-ubuntu.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
title: Ubuntu에 OpenJDK 17 설치
author: dejavuhyo
date: 2024-08-27 08:35:00 +0900
categories: [DevOps, Linux]
tags: [ubuntu-openjdk ubuntu-jdk, openjdk, openjdk-install]
---

## 1. 버전 확인
설치 가능한 openjdk 버전을 확인한다.

```shell
# 모든 버전 조회
$ sudo apt list openjdk*

# 특정 버전 조회
$ sudo apt list openjdk-[버전]*
```

## 2. 설치

```shell
$ sudo apt install openjdk-17-jdk
```

## 3. 설치 확인

```shell
$ java --version
```

## 4. 환경변수 설정

```shell
sudo vim /etc/profile
```

하단에 추가한다.

```text
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 # Java 설치경로
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/ext:$JAVA_HOME/lib/tools.jar
```

설정 파일의 변경사항을 적용한다.

```shell
$ source /etc/profile
```

환경변수 설정을 확인한다.

```shell
$ echo $JAVA_HOME
/usr/lib/jvm/java-17-openjdk-amd64
```

## [출처 및 참고]
* [https://velog.io/@ung6860/개발환경Ubuntu에-Java-설치하기](https://velog.io/@ung6860/개발환경Ubuntu에-Java-설치하기)