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] ๋ณ๊ฒฝ
์ ๋ง ๋ด๊ฐ ์๊พธ ๊น๋จน์ด์ ์ด ๊ธ... ^_^......
์์ผ๋ก ๋ณ๊ฒฝํ ๋๋ง๋ค ๋ด์ผ๊ฒ ๋ค.