강의

멘토링

로드맵

Inflearn brand logo image

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

이DH님의 프로필 이미지
이DH

작성한 질문수

Spring Boot와 React로 배우는 초간단 REST API 게시판 만들기

개발 환경 세팅

(재업) 선생님 제발 도와주세요

작성

·

44

·

수정됨

0

image.png

일단 여기서 이렇게 뜨구요

 

 

 

이거 전에

Spring Initializr

여기서 설정하고 그거 열어줘서 작업하는건데

 

저렇게 뜨는데 어떻게해야하나요...
혹시나 PracApplication.java 에서 실행하면

 

image.png


Execution failed for task ':restapi.prac.PracApplication.main()'.

> Process 'command 'C:\Program Files\Java\jdk-21\bin\java.exe'' finished with non-zero exit value 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.

> Get more help at https://help.gradle.org.

BUILD FAILED in 12s

3 actionable tasks: 1 executed, 2 up-to-date

 

이렇게 또 에러가 뜨구요...

추가로 ai답변으로 build.gradle 의 dependencies 확인하래서

 

image.png

 

image.png

 

이거 확인했는데 이상없는거 같고 정상적으로 C:\Program Files\Java\jdk-21\bin\java.exe 이 경로에 있습니다.

 

 

마지막으로

 

image.png

이렇게 build.gradle을 연 상태로 run을 하면되는데 (localhost:8080 은 안열림)

application.properties 에서는 run 버튼 자체가 활성화가 안되있고

 

PracApplication.java 에서는 run이 활성화는 되있지만 계속 제가 말헀던 에러가 뜹니다



제발 ai답변말고 선생님이 답변해주시면 감사하겠습니다

답변 1

0

영넨님의 프로필 이미지
영넨
지식공유자

안녕하세요!

이미지상에서는 정상적으로 빌드는 완료가 된거같은데 실행하는 부분에서 오류가 발생한거 같네요.

일단 java 버전이 21버전이 정상적으로 설치되었는지, 환경변수가 제대로 되어있는지 확인해보시겠어요?

이DH님의 프로필 이미지
이DH
질문자

image.pngimage.pngimage.png

환경변수 설정잘되있고 ide 상에서 java -version 쳤을때 잘나옵니다 ㅠㅠ
start.spring.io 여기서 만들떄도 21 버전으로 선택했구요

혹시나 문제 있나싶어서 ide도 다시 지웠다 깔고, jdk도 다시 지웠다 깔고 , start.spring.io 도 다시 새로 하고 해도 안되네요 ㅠㅠ

 

Execution failed for task ':restapi.prac.PracApplication.main()'.

> Process 'command 'C:\Program Files\Java\jdk-21\bin\java.exe'' finished with non-zero exit value 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.

> Get more help at https://help.gradle.org.

BUILD FAILED in 9s

3 actionable tasks: 1 executed, 2 up-to-date

 

이 에러메시지가 도대체 뭔질 모르곘네요,,, gpt한테 물어봐도 알수없는 말만하고

지금 이 에러는 그냥 단순히 PracApplication.main()을 실행하는데 실패했다는 결과만 알려주고 있어서 강의자분도 답변이 어려우실 거에요.
일단 자바를 실행하신 다음에 터미널에 뜨는 --scan 부분이 클릭이 가능할 거에요.
*************************** APPLICATION FAILED TO START *************************** Description: Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured. Reason: Failed to determine a suitable driver class Action: Consider the following: If you want an embedded database (H2, HSQL or Derby), please put it on the classpath. If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active). > Task :restapi.practice.PracticeApplication.main() FAILED 3 actionable tasks: 2 executed, 1 up-to-date FAILURE: Build failed with an exception. What went wrong: Execution failed for task ':restapi.practice.PracticeApplication.main()'. > Process 'command 'C:\Program Files\Java\jdk-24\bin\java.exe'' finished with non-zero exit value 1 Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Get more help at https://help.gradle.org. BUILD FAILED in 7s Publishing a build scan to scans.gradle.com requires accepting the Gradle Terms of Use defined at https://gradle.com/help/legal-terms-of-use. Do you accept these terms? [yes, no]
그 부분을 클릭해야 위 처럼 정확히 어느 부분이 문제가 되어서 지금 터지고 있다고 자세하게 알 수 있어요. 그걸 공유해주시면 강의자 분도 더 대답하기 쉬워질겁니다.

이DH님의 프로필 이미지
이DH

작성한 질문수

질문하기