0
2

More than 3 years have passed since last update.

【Spring】環境構築

Last updated at Posted at 2020-04-19

IDE 準備

https://mergedoc.osdn.jp/ からJavaの「Full Edition」をダウンロードする。
その後、適切な場所に解凍し起動する。

プロジェクト作成

「ファイル → 新規 → その他」 を選択
image.png

「Spring スタータープロジェクト」を選択
image.png

image.png

使用するものがあれば適宜選択してください。
image.png

image.png

上記手順ではデータベースを使用するため、データベースの設定を行う
※下記はサンプルなので適宜修正してください
/demo/src/main/resources/application.properties
spring.datasource.url=jdbc:mysql://localhost/{データベース名}?serverTimezone=JST
spring.datasource.username={ユーザ名}
spring.datasource.password={パスワード}
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

アプリケーション起動

起動手順

プロジェクトを右クリック → 実行 → Spring Boot アプリケーション
image.png

起動確認

ブラウザで http://localhost:8080/ を開く。
下記の通りエラーが面が表示されるが、コントローラーなどがないため発生するものなので問題ない。
image.png

0
2
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
2