π Java 25 & STS 5.1.0 μ κ·Έλ μ΄λ: μ°¨μΈλ μ€νλ§ λΆνΈ νκ²½ ꡬμΆκΈ°
Last Updated: 2026λ 03μ 17μΌ
κΈ°μ‘΄ sts-4.27.0μμ μ΅μ sts-5.1.0μΌλ‘ μ κ·Έλ μ΄λνλ©°, Java 25(Early Access/Modern JDK) κΈ°λ°μ κ°λ° νκ²½μ μΈν ν κ³Όμ μ κΈ°λ‘ν©λλ€. λ€λ₯Έ μΆκ°μ¬νμ μκ°λλ©΄…
0. μμ€ν νκ²½ λ³μ μ κ²
κ°μ₯ λ¨Όμ OS λ 벨μ νκ²½ λ³μκ° μ¬λ°λ₯΄κ² μ€μ λμ΄ μλμ§ νμΈν©λλ€. (Java 25 μ¬μ©μ μν΄ JAVA_HOME κ²½λ‘λ μν©μ λ°λΌ μ
λ°μ΄νΈκ° νμν©λλ€.)
- JAVA_HOME:
D:\Java\jdk-21.0.6(μΆν 25 μ μ μ μ© μ λ³κ²½) - GRADLE_HOME:
D:\Java\gradle_home - MYSQL_HOME:
D:\Java\MariaDB 11.7 - Path:
%JAVA_HOME%\bin,%GRADLE_HOME%\bin,%NODE_HOME%λ±
1. κΈ°μ‘΄ κ°λ° νκ²½ κΈ°λ‘ (Pre-check)
μ
κ·Έλ μ΄λ μ , κΈ°μ‘΄ IDE(Preferences)μ μ£Όμ μ€μ κ°μ λ©λͺ¨ν΄λ‘λλ€.
- Gradle: Local Installation (
D:\Java\gradle_home) - Java: Compiler compliance level (
21) - JREs: Installed JREs νμΈ
2. μ λ²μ λ€μ΄λ‘λ λ° μ€μΉ
Spring 곡μ μ¬μ΄νΈμμ μ΅μ λ²μ μ λ€μ΄λ‘λν©λλ€.
- λ€μ΄λ‘λ: spring.io/tools#eclipse
- λ³κ²½ μ¬ν:
sts-4.27.0.RELEASEβsts-5.1.0.RELEASE
3. μν¬μ€νμ΄μ€(Workspace) μ΄κΈ°ν
κΈ°μ‘΄ μν¬μ€νμ΄μ€μμ μΆ©λμ λ°©μ§νκΈ° μν΄ ν΄λλͺ μ λ³κ²½νκ³ μλ‘ μμ±ν©λλ€.
- κΈ°μ‘΄:
workspaceβworkspace_260317(λ°±μ ) - μ κ·:
workspaceν΄λ μμ± - μ°Έκ³ : κΈ°μ‘΄ workspace ν΄λλ κ·Έλλ‘ λκ³ workspace_sts-5.1.0 μΌλ‘ ν΄λ λ¨.
4. μ κ· νλ‘μ νΈ μμ± (New Spring Starter Project)
STS 5.1.0μ μ€ννκ³ Java 25 κΈ°λ°μ νλ‘μ νΈλ₯Ό μμ±ν©λλ€.
- Type: Gradle – Groovy
- Java Version: 25 (Project Loom κ°μ μ€λ λ νμ© κ°λ₯)
- Artifact/Group:
demo/kr.narrator - Dependencies: Web, JPA, MariaDB, Lombok, Validation, Thymeleaf λ±
5. IDE κ°μΈ μ€μ (UI/UX)
κ°μ₯ λ¨Όμ λμ νΈμν¨μ μν΄ ν°νΈλ₯Ό μ€μ ν©λλ€.
General>Appearance>Colors and Fonts>Basic>Text Font
6. νλ‘μ νΈ μ€μ μ΅μ ν (ν΅μ¬ ν¬μΈνΈ!)
μ΅μ λ²μ κ³Ό Java 25μ μ΅μ νλ μ€μ μμ μ μ§νν©λλ€.
π .env νμΌ μμ±
보μ λ° νκ²½ κ΄λ¦¬λ₯Ό μν΄ νλ‘μ νΈ μ΅μμ 루νΈμ .env νμΌμ μμ±νκ³ DB μ 보 λ±μ λ΄μ΅λλ€.
π application.yml μμ±
application.propertiesλ₯Ό YAMLλ‘ λ³ν ν, κ°μ μ€λ λ(Virtual Threads) μ€μ μ μΆκ°ν©λλ€.
spring:
application:
name: demo
profiles:
active: local # μ΄μ μ 'prod'λ‘ λ³κ²½
include:
- datasource
config:
import: optional:file:.env[.properties] # .env import
# Java 21 μ΄μ(Java 25 ν¬ν¨) ν΅μ¬ μ€μ : κ°μ μ€λ λ νμ±ν
threads:
virtual:
enabled: true
#############################################
# Server
server:
port: ${SERVER_PORT:9090}
shutdown: graceful # μ’
λ£ μ μ§ν μ€μΈ μμ²μ μμ νκ² μ²λ¦¬ (Java 25 κ°μ μ€λ λ μ 리 ν¬ν¨)
tomcat:
max-connections: 2000 # μ€λ λ κ°μκ° μλ μ΅λ λμ μ°κ²° μ μ μ΄
π application-datasource.yml μμ±
κ°μ μ€λ λ νκ²½μμλ κΈ°μ‘΄μ max-threads μ€μ λμ ν¨μ¨μ μΈ μ»€λ₯μ
ν κ΄λ¦¬κ° μ€μν©λλ€. (μμ±λͺ
κ²½κ³ λ°©μ§λ₯Ό μν΄ νμ΄ν λ°©μ κΆμ₯)
spring:
config:
activate:
on-profile: "datasource"
datasource:
driver-class-name: org.mariadb.jdbc.Driver
url: jdbc:mariadb://${DB_HOST}:${DB_PORT}/${DB_NAME}?serverTimezone=Asia/Seoul&allowPublicKeyRetrieval=true
username: ${DB_USER}
password: ${DB_PASSWORD}
hikari:
pool-name: NarratorHikariCP
maximum-pool-size: 10
minimum-idle: 5
idle-timeout: 30000
max-lifetime: 1800000
connection-timeout: 20000
jpa:
hibernate:
ddl-auto: update # λλ validate, none, create λ±
show-sql: false
properties:
hibernate:
format-sql: false
use-sql-comments: false
highlight-sql: true
open-in-view: false
7. ν μ€νΈ μ½λ μμ±
π’ IndexController.java
package kr.narrator.demo;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringBootVersion;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
@Controller
public class IndexController {
@Value("${spring.application.name}")
private String appName;
@GetMapping("/") // "/" κ²½λ‘λ‘ μ μνλ©΄ index.htmlμ 보μ¬μ€λλ€.
public String index(Model model) {
model.addAttribute("appName", appName);
model.addAttribute("javaVersion", System.getProperty("java.version"));
model.addAttribute("springBootVersion", SpringBootVersion.getVersion());
return "index"; // templates/index.html νμΌμ μ°Ύμ΅λλ€.
}
}
π΅ index.html (Thymeleaf)
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Java 25 + Spring Boot 3.4 λ°λͺ¨</title>
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-color: #f4f7f6;
}
.container {
text-align: center;
background: white;
padding: 2rem 3rem;
border-radius: 10px;
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
h1 {
color: #2c3e50;
}
p {
color: #7f8c8d;
font-size: 1.1rem;
}
.highlight {
color: #27ae60;
font-weight: bold;
}
</style>
</head>
<body>
<div class="container">
<h1>μλ² μ€ν μ±κ³΅! π</h1>
<p>νλ‘μ νΈ μ΄λ¦: <span class="highlight" th:text="${appName}">demo</span></p>
<p>Java λ²μ : <span class="highlight" th:text="${javaVersion}">25</span></p>
<p>Spring Boot λ²μ : <span class="highlight" th:text="${springBootVersion}">3.4.1</span></p>
<p>κ°μ μ€λ λ(Loom): <span class="highlight">νμ±νλ¨ β
</span></p>
</div>
</body>
</html>
8. μ΅μ’ κ²°κ³Ό νμΈ
μλ²λ₯Ό κΈ°λνκ³ λΈλΌμ°μ μμ μ μν©λλ€.
URL:
http://localhost:9090/
μ±κ³΅! μ΄μ Java 25μ κ°λ ₯ν μ±λ₯κ³Ό STS 5.1.0μ μΎμ ν νκ²½μμ κ°λ°μ μμν μ μμ΅λλ€. π
π‘ κΏν: STS 5.x λ²μ λΆν°λ YAML μλν°μ κ²μ¬κ° μ격ν΄μ‘μ΅λλ€. [format_sql] μ²λΌ λκ΄νΈλ₯Ό μ°κ±°λ format-sqlμ²λΌ νμ΄ν νμμ μ¬μ©νλ©΄ κ²½κ³ λ₯Ό μ§μΈ μ μμ΅λλ€!
[2026.03.17] lombok λ¬Έμ ν΄κ²°
- sts μ€μΉ ν΄λμ lombok.jar νμΌμ 볡μ¬νλ€.
- SpringToolsForEclipse.ini νλ¨μ -javaagent:D:\path\to\lombok.jar λ₯Ό μΆκ°νλ€.
- sts λ₯Ό μ€ν ν Project > Clean μ ν΄λ¦νλ€.
Java 25 λ²μ μμ ayout:decorate λ₯Ό μ¬μ©νλ©΄ μλ¬κ° λ°μνλλ°, build.gradle μμ λ²μ μ μ¬λ €μ€λ€.
implementation ‘nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:4.0.0’ // μμ ν λΆλΆ