• 카테고리

    질문 & 답변
  • 세부 분야

    백엔드

  • 해결 여부

    미해결

빌드 오류

23.04.26 16:48 작성 23.04.26 16:57 수정 조회수 1.72k

0

학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요.

1. 강의 내용과 관련된 질문을 남겨주세요.
2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요.
(자주 하는 질문 링크: https://bit.ly/3fX6ygx)
3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요.
(질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG)

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

[질문 내용]
여기에 질문 내용을 남겨주세요.

스프링부트 3.0 와 java 17을 사용하였습니다. cmd에서 gradlew를 실행하자

다음과 같은 오류가 계속 뜹니다.

 

 

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.6.

Required by:

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

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

- Variant 'apiElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.0.6 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 8

- Other compatible attribute:

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

- Variant 'javadocElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.0.6 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 8)

- 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.6.1')

- Variant 'mavenOptionalApiElements' capability org.springframework.boot:spring-boot-gradle-plugin-maven-optional:3.0.6 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 8

- Other compatible attribute:

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

- Variant 'mavenOptionalRuntimeElements' capability org.springframework.boot:spring-boot-gradle-plugin-maven-optional:3.0.6 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 8

- Other compatible attribute:

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

- Variant 'runtimeElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.0.6 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 8

- Other compatible attribute:

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

- Variant 'sourcesElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.0.6 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 8)

- 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.6.1')

 

 

setting 과 project structure 에서 모두 17로 설정했는데도 같은 오류가 반복됩니다.

답변 3

·

답변을 작성해보세요.

1

제이티시님의 프로필

제이티시

2023.04.29

같은 문제였는데,

start.spring.io 웹페이지 맨 아래에서

Java 버전 17로 변경하여 해결했습니다.

추측하건대, 아마 3.0.6처럼 3.x.x대의 버전에선 Java 11 이하는 지원하지 않는 듯 보입니다.

김영한 강사님께선 "Java 11로 갈게요~"하셨는데,

Java 11로 설정하면 "에러: Java 17 필요한데 왜 11로 했냐~" 라고 떠서, 저는 직접 변경해주었습니다.

다만, 이 경우 윈도우-cmd 창에서 'java -version' 쳤을 때 jdk 17.x.x 가 나올 수 있도록 [환경변수 설정]을 하셔야 됩니다~ 환경변수 설정 방법은 인터넷에 많으니까 참고하셔요.

0

OMG님의 프로필

OMG

2023.04.27

c드라이브 하위 경로로 프로젝트 폴더를 옮겨서 실행해도 동일한가요?

0

OMG님의 프로필

OMG

2023.04.26

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

로그를 보면 Java 8이 보이는데, PC에 설치된 자바 중 자바8이 있을까요?

자바 8이 있다면 자바17을 설치하시고 자바 환경 변수를 자바17로 세팅을 바꿔야 할 것 같습니다.

 

윈도우: 명령프롬프트(CMD)에서 java -version을 입력한 화면

맥: 터미널에서 java -version을 입력한 화면

을 캡쳐(+build.gradle도 포함)하여 올려주시면 확인에 도움이 될 것 같습니다.
.
감사합니다.

ib439님의 프로필

ib439

질문자

2023.04.27

image

ib439님의 프로필

ib439

질문자

2023.04.27

image

OMG님의 프로필

OMG

2023.04.29

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

추가로 올리신 글을 보아하니 해결 하신 것 같습니다. 혹 해결이 되지 않았다면 댓글 남겨주세요 ^^
.
감사합니다.