0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Docker】Java SE Development Kit 17環境を構築する

0
Last updated at Posted at 2026-03-29

1. はじめに

 前回の記事では、ORACLE MASTER資格に向けてOracle DB 26ai環境のセットアップを行いました。今回は、Oracle Certified Java Programmer資格に向けてOracle JDK 17環境をセットアップします。前回に引き続きDockerでのセットアップを行います。

本記事では以下のOSで動作確認を行っています。

2. Docker環境のセットアップ

 Docker環境については以下の記事を参照してセットップを行ってください。

3. Oracle JDK環境のセットアップ

3.1 コンテナ定義ファイルの作成

 プロジェクトルートに .devcontainer フォルダを作成し、その配下に .json ファイルを作成して配置します。なお、本番環境でのOracle JDK 17の利用については、2024年9月で無償期間が終了していますのでご注意ください。

Visual Studio Code .devcontainer/devcontainer.json
{
	"name": "Oracle JDK 17",
	"image": "ghcr.io/oracle/oraclelinux:8",
	"features": {
		"ghcr.io/devcontainers/features/common-utils:2": {
			"username": "vscode"
		},
		"ghcr.io/devcontainers/features/java:1": {
			"version": "17",
			"jdkDistro": "oracle"
		}
	},
	"containerEnv": {
		"TZ": "Asia/Tokyo"
	},
	"customizations": {
		"vscode": {
			"extensions": [
				"vscjava.vscode-java-pack"
			]
		},
		"settings": {
			"editor.formatOnSave": true,
			"editor.codeActionsOnSave": {
				"source.organizeImports": "explicit"
			},
			"files.eol": "\n"
		}
	},
	"remoteUser": "vscode"
}

 プロジェクトルートのフォルダをVSCodeで開くと、「コンテナで再度開く」ボタンのハイライトされたポップアップが画面右下に表示されます。これをクリックすると、裏でなんやかんや動いて開発環境のできあがりですw

3.2 Javaの動作確認

 以下を作成して実行すると、ターミナルに Hello Oracle JDK 17! と出力されます。

Visual Studio Code Hello.java
public class Hello {
    public static void main(String[] args) {
        System.out.println("Hello Oracle JDK 17!");
    }
}

4. おわりに

 紫本を紐解いたところ、データベース接続はSilverの試験範囲に含まれていない模様。まずは、この構成で勉強を進めようと思います。データベース接続向けのセットアップを追記するか別記事にするかについては、後日検討しようかと。。。

◀️ 前の記事 次の記事 ▶️
【Docker】Oracle AI Database 26ai Free環境を構築する PCセットアップ手順書をMarkdownで書いてPDFで保存する
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?