๊ด€๋ฆฌ ๋ฉ”๋‰ด

It's easy, if you try

[Mac/ Spring Boot] IntelliJ - invalid source release ํ•ด๊ฒฐ ๋ฐฉ๋ฒ• ๋ณธ๋ฌธ

๊ฐœ๋ฐœํ™˜๊ฒฝ

[Mac/ Spring Boot] IntelliJ - invalid source release ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•

s5he2 2021. 7. 18. 15:02
๋ฐ˜์‘ํ˜•

๐Ÿ“Œ ์—๋Ÿฌ ๋‚ด์šฉ

Execution failed for task ':compileJava'. > invalid source release: 11

JDK ๋ฒ„์ „๊ณผ project language level์ด ๋‹ฌ๋ผ์„œ ์ƒ๊ธฐ๋Š” ์—๋Ÿฌ์ž…๋‹ˆ๋‹ค.

๐Ÿ“Œ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•

File -> Project Structure

์ €๋Š” Project language level ์ด 11๋กœ ์„ค์ • ๋˜์–ด์žˆ์—ˆ๊ณ , ์ด๋Š” SDK 1.8 ๋ฒ„์ „๊ณผ ๋งž์ง€ ์•Š์•„์„œ ์ƒ๊ธด ์˜ค๋ฅ˜์˜€์Šต๋‹ˆ๋‹ค!

SDK default๋กœ ์„ค์ •ํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค.

์ฐธ๊ณ ๋กœ, SDK์˜ java ๋ฒ„์ „์„ JDK๋ผ๊ณ  ์ดํ•ดํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค!

์„ค์ •์„ ํ•˜๊ณ  build, run์„ ํ•ด๋„ ๊ฐ™์€ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.

build.gradle ํŒŒ์ผ๋กœ ๋“ค์–ด๊ฐ€์„œ sourceCompatibility ๋ฅผ SDK default ๋ฒ„์ „(์ €์™€ ๊ฐ™์€ ๊ฒฝ์šฐ์—” 8์ž…๋‹ˆ๋‹ค.)์— ๋งž๊ฒŒ ์ˆ˜์ •ํ•ด์ฃผ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

์•„๋ž˜ ๋ชจ์–‘์˜ Load Gradle Changes ๋ฒ„ํŠผ์„ ๋ˆ„๋ฅธ ํ›„ build, run์„ ํ•˜๋ฉด ์ œ๋Œ€๋กœ ์‹คํ–‰๋˜๋Š” ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค!

 

๐Ÿ“Œ ๊ฒฐ๊ณผ

๋ฐ˜์‘ํ˜•
Comments