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?

Spring Boot環境構築

Last updated at Posted at 2025-02-15

方針

学習のためSpring BootでREST APIを用いたアプリケーションを作成し、
GitHubに上げ、AWSへデプロイするまでを行う。

①JDK導入

無料で商用利用できるOpenJDKのEclipse Temurin(Adoptium)を選択。
https://adoptium.net/

  • ダウンローダー起動後、Set JAVA_HOME variableをクリックし、「ローカルハードドライブにインストールする」 を選択。
    これによりJAVA_HOME環境変数が設定され、Eclipse や Mavenなどが正常に動くようになる。
  • 以下のディレクトリが生成される。
    image.png

②Spring Tools for Eclipse導入

STS(Spring Tool Suite)が付属したEclipse。
https://spring.io/tools

ダウンロードしたZIPファイルを解凍し、中のSpringToolSuite4.exeを実行することで起動。

Microsoft Defender Exclusion Checkのダイアログボックスが出たら、Windows Defender によるスキャンを除外するかどうかを選択。動作が重くなければKeep~(スキャン対象にする)で良さそう。
後で除外したくなったら、[Windows 設定] → [更新とセキュリティ] → [Windows セキュリティ] → [ウイルスと脅威の防止] → [設定の管理] → [除外の追加] → Spring Tools 4 のフォルダを選択

③STSが使うJava実行環境(JVM)の設定

-vmオプションを設定することで特定のJDK/JREを実行環境に指定できる。
指定しない場合、システム環境変数のPATHにあるJavaが使われる。

・コマンドプロンプトでwhere javaを実行し、JDKのパスを確認
・STSのフォルダにあるSpringToolSuite4.iniを開き、-vmの設定を、確認したパス\javaw.exeに変更
※-vmの位置は-startupより上に置く。下だと設定が無視される。
image.png

image.png

これにより複数のJavaバージョンがインストールされていても、適したJDKを確実に使える。

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?