인프런 커뮤니티 질문&답변

유성현님의 프로필 이미지
유성현

작성한 질문수

스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술

hello-spring 빌드가 안되요.

작성

·

1.3K

·

수정됨

1

[질문 템플릿]
1. 강의 내용과 관련된 질문인가요? (예/아니오)
2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)
3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)

[질문 내용]
시작부터 막히니 머리가 핑 돌아요.

자바 버전이 문제인가, 싶어서 처음엔 프로젝트 스트럭쳐 건들다가 결국 자바 11 제외하고는 전부 삭제하고 환경 변수도 다시 건들고, 구글링과 질문란 이것저것 살펴보면서 시도해봤는데 머리만 더 꼬이고 해결은 되지 않아요 ㅠㅠ

 

A problem occurred configuring root project 'hello-spring'.

> Could not resolve all files for configuration ':classpath'.

> Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.0.0.

Required by:

project : > org.springframework.boot:org.springframework.boot.gradle.plugin:3.0.0

> No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.0.0 was found. The consumer was configured to find a runtime of a library compatible with Java 11, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '7.5.1' but:

- Variant 'apiElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.0.0 declares a library, packaged as a jar, and its dependencies declared externally:

- Incompatible because this component declares an API of a component compatible with Java 17 and the consumer needed a runtime of a component compatible with Java 11

- Other compatible attribute:

- Doesn't say anything about org.gradle.plugin.api-version (required '7.5.1')

- Variant 'javadocElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.0.0 declares a runtime of a component, and its dependencies declared externally:

- Incompatible because this component declares documentation and the consumer needed a library

- Other compatible attributes:

- Doesn't say anything about its target Java version (required compatibility with Java 11)

- Doesn't say anything about its elements (required them packaged as a jar)

- Doesn't say anything about org.gradle.plugin.api-version (required '7.5.1')

- Variant 'mavenOptionalApiElements' capability org.springframework.boot:spring-boot-gradle-plugin-maven-optional:3.0.0 declares a library, packaged as a jar, and its dependencies declared externally:

- Incompatible because this component declares an API of a component compatible with Java 17 and the consumer needed a runtime of a component compatible with Java 11

- Other compatible attribute:

- Doesn't say anything about org.gradle.plugin.api-version (required '7.5.1')

- Variant 'mavenOptionalRuntimeElements' capability org.springframework.boot:spring-boot-gradle-plugin-maven-optional:3.0.0 declares a runtime of a library, packaged as a jar, and its dependencies declared externally:

- Incompatible because this component declares a component compatible with Java 17 and the consumer needed a component compatible with Java 11

- Other compatible attribute:

- Doesn't say anything about org.gradle.plugin.api-version (required '7.5.1')

- Variant 'runtimeElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.0.0 declares a runtime of a library, packaged as a jar, and its dependencies declared externally:

- Incompatible because this component declares a component compatible with Java 17 and the consumer needed a component compatible with Java 11

- Other compatible attribute:

- Doesn't say anything about org.gradle.plugin.api-version (required '7.5.1')

- Variant 'sourcesElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.0.0 declares a runtime of a component, and its dependencies declared externally:

- Incompatible because this component declares documentation and the consumer needed a library

- Other compatible attributes:

- Doesn't say anything about its target Java version (required compatibility with Java 11)

- Doesn't say anything about its elements (required them packaged as a jar)

- Doesn't say anything about org.gradle.plugin.api-version (required '7.5.1')

* Try:

> Run with --stacktrace option to get the stack trace.

> Run with --info or --debug option to get more log output.

> Run with --scan to get full insights.

 

 

짧은 영어 실력으로는

 

아무리 봐도 자바 버전 호환이 안되는 것 같은데, 11 제외하고 모두 삭제했는데도 이러네요 ㅠㅠ

 

다음은 cmd 에서 버전 확인 한 결과인데요

 

C:\Users\user>javac -version

javac 11.0.2

C:\Users\user>java -version

openjdk version "11.0.2" 2019-01-15

OpenJDK Runtime Environment 18.9 (build 11.0.2+9)

OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)

C:\Users\user>

 

어떻게 해야 할까요...

답변 1

2

안녕하세요. 유성현님, 공식 서포터즈 OMG입니다.
.

스프링부트3은 자바 버전 17부터 지원합니다.

자바11이 세팅된 경우 스프링부트 버전 2.7.x를 선택해주세요
.
감사합니다.

유성현님의 프로필 이미지
유성현

작성한 질문수

질문하기