Hi, I just downloaded the latest version of nctoolbox from github. I am using MATLAB R2021b. When I tried "setup_nctoolbox", I got the following ERROR message : "Failed to setup the Java classpath".
I checked nctoolbox and I saw that in C:\Program Files\MATLAB\nctoolbox-master\java\ it contains the file "log4j-1.2.17.jar", and my MATLAB distribution contain in C:\Program Files\MATLAB\R2021b\java\jarext\ 3 files:
log4j-1.2-api-2.17.0.jar
log4j-api-2.17.0.jar
log4j-core-2.17.0.jar
I tried 2 actions:
1/ Delete the log4j-1.2.17.jar from nctoolbox-master\java\
2/ Copy the 3 jar files from R2021b path to nctoolbox path
In both cases, I got the same error message :(
Any suggestions how to fix this problem ?

 채택된 답변

Fan Chen
Fan Chen 2022년 2월 24일

10 개 추천

Hi, I just encountered the same problem. A quick fix is to disable(comment) the line:
root.addAppender(org.apache.log4j.ConsoleAppender(org.apache.log4j.PatternLayout('%d{ISO8601} [%t] %-5p %c %x - %m%n')));
in the ...\nctoolbox-master\java\setup_nctoolbox_java.m file.
It seems to work fine after that, although I am not sure of any complications this could cause. Hope someone could provide a better solution.

댓글 수: 11

Christos Stefanakos
Christos Stefanakos 2022년 2월 28일
yes, i did the same thing. thnx
it's work!
Sahar Dehnavi
Sahar Dehnavi 2022년 6월 28일
Great it works after commenting this line
Hung Cheng Tao
Hung Cheng Tao 2022년 9월 15일
I did the same step but still can't work. Do you have any other idea for that plz?
Adam Campos
Adam Campos 2022년 10월 10일
Thank you, commenting that line out helped.
yanan
yanan 2023년 9월 18일
Thank you!
雨桐 吴
雨桐 吴 2024년 1월 11일
thank you 太有帮助了!!!
Jane
Jane 2024년 2월 23일
thank you! it's work
Peiqi Huang
Peiqi Huang 2024년 3월 13일
thx!! it's fine now
Camila Gordon
Camila Gordon 2024년 5월 21일
This works, thank you !
Hanqi
Hanqi 2025년 3월 23일
works!thx a lot!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품

릴리스

R2021b

질문:

2022년 1월 25일

댓글:

2025년 3월 23일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by