.인프런을 통해 강의를 공부하던 중 다음 명령어를 사용하게 되었다.
PS C:\Users\TUF\Documents\GitHub\coupon2\coupon> ./gradlew --stop; ./gradlew jibDockerBuild;
그리고 다음과 같은 에러를 마주하게 되었다.
What went wrong:
Gradle requires JVM 17 or later to run. Your build is currently configured to use JVM 11.
해당 문제의 해결 방법은 다음과 같으며 윈도우 OS 환경에서 문제 해결 방법은 다음과 같다.
1. 먼저 JDK 17 버전을 다운로드 한다.
winget install EclipseAdoptium.Temurin.17.JDK
2. 다운로드된 JDK 경로를 확인한다.
Get-ChildItem "C:\Program Files\Eclipse Adoptium" -ErrorAction SilentlyContinue
3. 위 명령어를 사용하여 다음과 같은 결과를 확인한다.
PS C:\Users\TUF\Documents\GitHub\coupon2\coupon> Get-ChildItem "C:\Program Files\Eclipse Adoptium" -ErrorAction SilentlyContinue
디렉터리: C:\Program Files\Eclipse Adoptium
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 2026-09-12 오후 11:06 jdk-17.0.20.101-hotspot
4. powerShell에서 해당되든 프로젝트 경로에서 다음 명령어를 수행한다.
notepad .\gradle.properties
5. 그리고 org.gradle.java.home 줄을 아래처럼 수정한다. 각자 Get-childItem에서 얻은 결과를 참조해서 수정하면된다.
org.gradle.java.home=C:\\Program Files\\Eclipse Adoptium\\jdk-17.0.20.101-hotspot
6. 저장후 다음 명령어로 gradle 버전이 잘 수정되었는지 확인한다.
./gradlew --stop
./gradlew -version
7. 명령어를 수행하면 다음과 같은 결과를 얻는다.
PS C:\Users\TUF\Documents\GitHub\coupon2\coupon> ./gradlew -version
------------------------------------------------------------
Gradle 9.7.1
------------------------------------------------------------
Build time: 2026-08-19 14:16:09 UTC
Revision: 92f0512e7f06d84621afba191f75e26536120cf
Kotlin: 2.4.0
Groovy: 4.0.32
Ant: Apache Ant(TM) version 1.10.17 compiled on April 6 2026
Launcher JVM: 11.0.2 (Oracle Corporation 11.0.2+9)
Daemon JVM: C:\Program Files\Eclipse Adoptium\jdk-17.0.20.101-hotspot (from org.gradle.java.home)
OS: Windows 10 10.0 amd64
결과를 확인하면 Launcher JVM은 11.0.2 버전이지만 해당 정보는 gradlew 실행 스크립트를 처음 띄우는 JVM일 뿐이고, 실제 빌드는 Daemon JVM인 17에서 돌아가므로 Daemon JVM이 17 버전인지 확인하면 된다.