본문 바로가기

카테고리 없음

SpringBoot 3.2.5 Initializer

반응형

https://start.spring.io/

Spring Web, Thymeleaf 추가

GENERATE 버튼 클릭하면 기본 세팅 프로젝트가 다운로드 된다.

 

참고로 현재는 Spring initializer 2.0 지원을 하지 않기 때문에 3.0을 설치해야한다.

2.0은 JDK 11을 설치하면 됐지만

3.0은 17을 설치해줘야 한다.

보통 11정도 설치되어 있을테니 JDK 다운로드 후 환경 변수 설정도 해줘야 한다.

 

- JDK 17 Download

https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html

 

Java Archive Downloads - Java SE 17

WARNING: Older versions of the JDK are provided to help developers debug issues in older systems. They are not updated with the latest security patches and are not recommended for use in production. For production use Oracle recommends downloading the late

www.oracle.com

 

- 환경 변수 설정은 아래 블로그 참고
https://hyoje420.tistory.com/7

 

[Java]환경변수(JAVA_HOME & CLASSPATH)

환경변수 공식적인 의미의 환경변수(Environment variable)는 프로세스가 컴퓨터에서 동작하는 방식에 영향을 미치는 동적인 값들이다. OS상에서 동작하는 응용프로그램들이 참조하기위한 설정이 기

hyoje420.tistory.com

 

IntelliJ로 프로젝트를 열어봤지만 에러 발생.

> Could not resolve all artifacts for configuration ':classpath'.
   > Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.2.5.
     Required by:
         project : > org.springframework.boot:org.springframework.boot.gradle.plugin:3.2.5
      > No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.2.5 was found. The consumer was configured to find a library for use during runtime, compatible with Java 11, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.7' but:
          - Variant 'apiElements' declares a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component for use during compile-time, compatible with Java 17 and the consumer needed a component for use during runtime, compatible with Java 11
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '8.7')

Java 17이 필요한데 Java 11로 설정돼서 빌드가 안된다고 한다.

로컬 jdk는 17이지만 IntelliJ Gradle JDK 버전 설정이 잘못된 것 같다.

설정 확인을 하기 위해선 File -> Setting -> Gradle -> Gradle JVM에서 확인할 수 있다.

17로 변경 후 Apply하면 빌드 성공

반응형