본문 바로가기

에러해결

sts3 [Spring Legucy Project] 생성 시 에러(해결)

 

상황

 

실행환경
- window10
- sts 3.9.17
- jdk 19

 

sts에서 [Spring Legucy Project] 생성 시 다음과 같은 에러 발생하였다.

An error has occurred. See error log for more details.
java.lang.ExceptionInInitializerError
An error has occurred. See error log for more details.
Could not initialize class com.thoughtworks.xstream.converters.collections.PropertiesConverter

 

대충 초기화 할 수 없다는 뜻 같다.

 

원인

 

  • sts 3.9.17에는 jdk11이 필요하다.

 

해결

 

  • 기존 자바 버전을 삭제하고 새 버전을 설치할 수 있지만, 여러 버전을 동시에 사용하는 것을 택했다.\
  • 만약 안된다면 재부팅하거나, 프로그램(sts, cmd 등)을 재시작해보자.

 

  1. java11 설치
  2. java 설치 폴더에 scripts 폴더를 생성
  3. scripts 폴더 안에 JAVA_HOME 환경 변수를 변경하는 .bat 파일을 생성
  4. cmd에서 "java11" or "java19"로 변경

 

 

JDK 여러 버전 설치하여 사용하기

쉽게 전환하는 법

velog.io

 

참고