• 카테고리

    질문 & 답변
  • 세부 분야

    백엔드

  • 해결 여부

    미해결

빌드하고 실행하기 gradlew build 에러 ㅠㅠ

22.12.05 21:33 작성 조회수 3.07k

0

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

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

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

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

 

 

intelllij환경설정 전부 이상없이 설정하였고, 자바 11사용중인데 cmd 창에서 빌드하려니 계속 아래와 같은 에러가 뜹니다 ㅠㅠ 어떻게 해결할 수 있을까요??

 

 

Task :test FAILED

Error: Could not find or load main class worker.org.gradle.process.internal.worker.GradleWorkerMain

Caused by: java.lang.ClassNotFoundException: worker.org.gradle.process.internal.worker.GradleWorkerMain

FAILURE: Build failed with an exception.

* What went wrong:

Execution failed for task ':test'.

> Process 'Gradle Test Executor 3' 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 3s

7 actionable tasks: 1 executed, 6 up-to-date

답변 5

·

답변을 작성해보세요.

0

gkwlsrnjs12님의 프로필

gkwlsrnjs12

2024.04.25

안녕하세요 동일한 문제로 열심히 삽질하다가 문제 해결했습니다

질문 기간이 오래되었으나 혹여나 저처럼 해결하지 못하는 분들께 조금이나마 도움되기를 바랍니다.

 

해당 문제는 현재 윈도우 사용자 계정이 한글로 설정되어 있어 발생한 문제로 보입니다.

 

  1. 영문으로 윈도우 사용자 계정 추가 후 관리자 권한 부여

  2. 신규 생성한 영문 계정으로 윈도우 접속 후 빌드 실행

  3. 빌드 실행 시 환경변수 오류 발생 시 파워셀이나 cmd를 관리자 권한으로 실행 후 빌드

이렇게 하니 정상적으로 빌드 되었습니다...

 

개발하는 pc에 사용자 계정과 폴더 경로는 한글이 아닌 영문으로 작성해야 합니다.

감사합니다.

0

knyatom님의 프로필

knyatom

2023.07.31

 gradlew build 시 나오는 에러입니다. 기본적으로 소스코드를 컴파일 못하는데요?

인텔리제에서는 잘 돌아갔었는데요.. 

image

D:\SpringTest\saproject>gradlew build

> Task :compileJava FAILED

D:\SpringTest\saproject\src\main\java\com\example\saproject\controller\ArticleController.java:41: error: cannot find symbol

return "redirect:/articles/" + saved.getId();

^

symbol: method getId()

location: variable saved of type Article

D:\SpringTest\saproject\src\main\java\com\example\saproject\controller\ArticleController.java:95: error: cannot find symbol

Article target = articleRepository.findById(articleEntity.getId()).orElse(null);

^

symbol: method getId()

location: variable articleEntity of type Article

D:\SpringTest\saproject\src\main\java\com\example\saproject\controller\ArticleController.java:103: error: cannot find symbol

return "redirect:/articles/" + articleEntity.getId();

^

symbol: method getId()

location: variable articleEntity of type Article

D:\SpringTest\saproject\src\main\java\com\example\saproject\dto\ArticleForm.java:30: error: constructor Article in class Article cannot be applied to given types;

return new Article(id, title, content);

^

required: no arguments

found: Long,String,String

reason: actual and formal argument lists differ in length

D:\SpringTest\saproject\src\main\java\com\example\saproject\entity\Comment.java:30: error: cannot find symbol

if (dto.getId() != null)

^

symbol: method getId()

location: variable dto of type CommentDto

D:\SpringTest\saproject\src\main\java\com\example\saproject\entity\Comment.java:32: error: cannot find symbol

if (dto.getArticleId() != article.getId())

^

symbol: method getArticleId()

location: variable dto of type CommentDto

D:\SpringTest\saproject\src\main\java\com\example\saproject\entity\Comment.java:32: error: cannot find symbol

if (dto.getArticleId() != article.getId())

^

symbol: method getId()

location: variable article of type Article

D:\SpringTest\saproject\src\main\java\com\example\saproject\entity\Comment.java:36: error: cannot find symbol

dto.getId(),

^

symbol: method getId()

location: variable dto of type CommentDto

D:\SpringTest\saproject\src\main\java\com\example\saproject\entity\Comment.java:38: error: cannot find symbol

dto.getNickname(),

^

symbol: method getNickname()

location: variable dto of type CommentDto

D:\SpringTest\saproject\src\main\java\com\example\saproject\entity\Comment.java:39: error: cannot find symbol

dto.getBody()

^

symbol: method getBody()

location: variable dto of type CommentDto

D:\SpringTest\saproject\src\main\java\com\example\saproject\entity\Comment.java:45: error: cannot find symbol

if (this.id != dto.getId())

^

symbol: method getId()

location: variable dto of type CommentDto

D:\SpringTest\saproject\src\main\java\com\example\saproject\entity\Comment.java:48: error: cannot find symbol

if (dto.getNickname() != null)

^

symbol: method getNickname()

location: variable dto of type CommentDto

D:\SpringTest\saproject\src\main\java\com\example\saproject\entity\Comment.java:49: error: cannot find symbol

this.nickname = dto.getNickname();

^

symbol: method getNickname()

location: variable dto of type CommentDto

D:\SpringTest\saproject\src\main\java\com\example\saproject\entity\Comment.java:50: error: cannot find symbol

if (dto.getBody() != null)

^

symbol: method getBody()

location: variable dto of type CommentDto

D:\SpringTest\saproject\src\main\java\com\example\saproject\entity\Comment.java:51: error: cannot find symbol

this.body = dto.getBody();

^

symbol: method getBody()

location: variable dto of type CommentDto

D:\SpringTest\saproject\src\main\java\com\example\saproject\dto\CommentDto.java:23: error: cannot find symbol

comment.getId(),

^

symbol: method getId()

location: variable comment of type Comment

D:\SpringTest\saproject\src\main\java\com\example\saproject\dto\CommentDto.java:24: error: cannot find symbol

comment.getArticle().getId(),

^

symbol: method getArticle()

location: variable comment of type Comment

D:\SpringTest\saproject\src\main\java\com\example\saproject\dto\CommentDto.java:25: error: cannot find symbol

comment.getNickname(),

^

symbol: method getNickname()

location: variable comment of type Comment

D:\SpringTest\saproject\src\main\java\com\example\saproject\dto\CommentDto.java:26: error: cannot find symbol

comment.getBody()

^

symbol: method getBody()

location: variable comment of type Comment

19 errors

FAILURE: Build failed with an exception.

* What went wrong:

Execution failed for task ':compileJava'.

> Compilation failed; see the compiler error output for details.

* 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 4s

1 actionable task: 1 executed

 

0

김승현님의 프로필

김승현

2022.12.09

아 이에러.. 골치아프죠.. 정말 간단한 에러부터 버전 미스매치 인코딩까지 다 포함되거든요..
Error: Could not find or load main class worker.org.gradle.process.internal.worker.GradleWorkerMain
이거 보면 아시겠지만
gradle/wrapper/gradle-wrapper.jar.
요 .jar 파일을 그래들이 못찾는거에요.

각설하고, 쓰신 코드를 보면 이 에러가 발생하신 이유가
아마 윈도우 환경에서 gradlew.bat 이 아니라 gradlew를 사용하셔서일거에요.
./gradlew.bat 을 같은 디렉토리에서 한번 사용해 보세요.

강사님이 지나가듯이 말씀하셨는데 놓치셨나보네요

0

OMG님의 프로필

OMG

2022.12.05

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

자주 발생되는 에러는 아니여서, 에러 메시지를 기반으로 직접 확인을 해주셔야 할 것 같습니다.

아래 링크를 참고해서 확인해주세요.

https://velog.io/@viiviii/test-%EC%8B%A4%ED%96%89-%EC%8B%9C-GradleWorkerMain%EC%9D%84-%EC%B0%BE%EC%9D%84-%EC%88%98-%EC%97%86%EB%8A%94-%EC%98%88%EC%99%B8
.
감사합니다.

0

채승민님의 프로필

채승민

질문자

2022.12.05

cmd 창 전체 내용입니다...ㅠㅠ

 

Microsoft Windows [Version 10.0.19045.2251]

(c) Microsoft Corporation. All rights reserved.

C:\Users\채승민>cd C:\Users\채승민\Desktop\Spring Project\hello-spring

C:\Users\채승민\Desktop\Spring Project\hello-spring>gradlew build

Could not write standard input to Gradle Test Executor 3.

java.io.IOException: ?뚯씠?꾧? ?ロ엳??以묒엯?덈떎

at java.base/java.io.FileOutputStream.writeBytes(Native Method)

at java.base/java.io.FileOutputStream.write(FileOutputStream.java:372)

at java.base/java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:125)

at java.base/java.io.BufferedOutputStream.implFlush(BufferedOutputStream.java:251)

at java.base/java.io.BufferedOutputStream.flush(BufferedOutputStream.java:239)

at org.gradle.process.internal.streams.ExecOutputHandleRunner.Runner.forwardContent(ExecOutputHandleRunner.java:68)

at org.gradle.process.internal.streams.ExecOutputHandleRunner.run(ExecOutputHandleRunner.java:53)

at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)

at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)

at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)

at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)

at java.base/java.lang.Thread.run(Thread.java:1589)

> Task :test FAILED

Error: Could not find or load main class worker.org.gradle.process.internal.worker.GradleWorkerMain

Caused by: java.lang.ClassNotFoundException: worker.org.gradle.process.internal.worker.GradleWorkerMain

FAILURE: Build failed with an exception.

* What went wrong:

Execution failed for task ':test'.

> Process 'Gradle Test Executor 3' 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 3s

7 actionable tasks: 1 executed, 6 up-to-date

 

 

 

 

codesweaver님의 프로필

codesweaver

2022.12.06

안녕하세요 채승민님.

아래의 링크도 한번 참조해보시겠어요?

https://programmer-jeong.tistory.com/15