DevLog ๐Ÿ˜ถ

[Intellij] terminal, Intellij project ์ž๋ฐ” ๋ฒ„์ „ ๋ณ€๊ฒฝํ•˜๋Š” ๋ฐฉ๋ฒ• ๋ณธ๋ฌธ

๊ฐœ๋ฐœ์ผ์ง€

[Intellij] terminal, Intellij project ์ž๋ฐ” ๋ฒ„์ „ ๋ณ€๊ฒฝํ•˜๋Š” ๋ฐฉ๋ฒ•

dolmeng2 2023. 5. 4. 16:07

๐ŸŒฑ ํ„ฐ๋ฏธ๋„์—์„œ ์ž๋ฐ” ๋ฒ„์ „ ๋ฐ”๊พธ๊ธฐ

๐Ÿ’ฌ ์„ค์น˜๋˜์–ด ์žˆ๋Š” ๋ชจ๋“  ์ž๋ฐ” ๋ฒ„์ „ (์œ„์น˜) ํ™•์ธ

/usr/libexec/java_home -V

 

 

๐Ÿ’ฌ JAVA_HOME ๋ณ€๊ฒฝํ•˜๊ธฐ

vim ~/.bash_profile

์œ„์—์„œ ํ™•์ธํ•œ ์ž๋ฐ” ๋ฒ„์ „ ๋”ฐ๋ผ์„œ JAVA_HOME ๋ณ€๊ฒฝํ•ด์ฃผ๊ธฐ

JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home
PATH=$PATH:$JAVA_HOME/bin
export JAVA_HOME
export PATH

 

 

๐Ÿ’ฌ ์—…๋ฐ์ดํŠธ๋œ ์‚ฌํ•ญ ์ ์šฉ

source ~/.bash_profile

 

โญ๏ธ ๋งŒ์•ฝ, zsh ์‰˜์„ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๋‹ค๋ฉด ํ™˜๊ฒฝ ์„ค์ • ์ •๋ณด๊ฐ€ ๋ง์”Œ์›Œ์ง€๊ธฐ ๋•Œ๋ฌธ์— ์—ฌ๊ธฐ์„œ ๊ผญ ๋ณ€๊ฒฝํ•ด์ค˜์•ผ ํ•œ๋‹ค.

vi ~/.zshrc

# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
export JAVA_HOME=$(/usr/libexec/java_home -v 11)
#export JAVA_HOME=$(/usr/libexec/java_home -v 17)

๋‚˜๋Š” 11์ด๋ž‘ 17 ๋ฒˆ๊ฐˆ์•„๊ฐ€๋ฉด์„œ ์“ฐ๋ ค๊ณ  2๊ฐœ ๋‹ค ์„ ์–ธํ•ด๋‘๊ณ  ์ฃผ์„์œผ๋กœ ์ฒ˜๋ฆฌํ•ด๋‘์—ˆ๋‹ค.

์‚ฌ์‹ค zsh ์‰˜์„ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๋‹ค๋ฉด ์ด ๋ถ€๋ถ„๋งŒ ํ•ด๋„ ๋œ๋‹ค.

 

 

๐Ÿ’ฌ ์‹ค์ œ๋กœ ์ ์šฉํ•˜๊ธฐ

source ~/.zshrc

 

 

๐Ÿ’ฌ ์‹ค์ œ ํ„ฐ๋ฏธ๋„์— ์ž˜ ์ ์šฉ๋˜์—ˆ๋Š”์ง€ ํ™•์ธ

java --version

 


๐ŸŒฑ Intellij Project Setting์—์„œ ์ž๋ฐ” ๋ฒ„์ „ ๋ณ€๊ฒฝํ•˜๊ธฐ

1. [File] - [Project Structure] - [Project] - [Project SDK] ๋ณ€๊ฒฝ

2. [File] - [Project Structure] - [Project] - [Project language level] ๋ณ€๊ฒฝ

 

3. [File] - [Project Structure] - [Module] - [Sources] - [Language level] ๋ณ€๊ฒฝ

 

4. [File] - [Project Structure] - [Module] - [Dependencies] - [Language level] ๋ณ€๊ฒฝ

 

5. [Preferences (Settings)] - [Build, Execution, Deployment] - [Compiler] - [Java Compiler] - [Project bytecode version] ๋ณ€๊ฒฝ

 

6. [Preferences (Settings)] - [Build, Execution, Deployment] - [Build Tools] - [Gradle] - [Gradle JVM] ๋ณ€๊ฒฝ

 

 

์ •๋ง ๋‚ด๊ฐ€ ์ž๊พธ ๊นŒ๋จน์–ด์„œ ์“ด ๊ธ€... ^_^......

์•ž์œผ๋กœ ๋ณ€๊ฒฝํ•  ๋•Œ๋งˆ๋‹ค ๋ด์•ผ๊ฒ ๋‹ค.

Comments