개인.Box

실리콘 맥 기본 세팅

일해라폴폴 2024. 8. 23. 00:29
반응형

먼저 zsh 에서 bash 로 기본 터미널 세팅을 변경 했다.
zsh는 뭔가 안맞음...

bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

==> Checking for `sudo` access (which may request your password)...
Password: # 맥북 비번 입력

알아서 쭉쭉쭉 설치 하면 (xcode 뭐시기 때문에 시간 좀 걸림) 아래 처럼 다 됐다고 나옴

- Run these two commands in your terminal to add Homebrew to your PATH:
    (echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/{user_mac}/.bash_profile
    eval "$(/opt/homebrew/bin/brew shellenv)"
- Run brew help to get started
- Further documentation:
    https://docs.brew.sh

위에 친절하게 환경 변수 설정 하라고 했는데, (이제 봄) 못해서 구글링 함
다들 zsh, bash 프로파일 설정 하라는데... 내껀 보니까 아예 프로파일 만들지도 않았다;;; 그래서 생성 하고 설정

touch .bash_profile
ls -al

drwxr-xr-x@  4 user_mac  staff    128  8  6 22:06 .android
-rw-------   1 user_mac  staff      0  8 22 23:33 .bash_history
-rw-r--r--   1 user_mac  staff      0  8 22 23:58 .bash_profile
drwx------  49 user_mac  staff   1568  8 22 23:47 .bash_sessions
drwxr-xr-x@  5 user_mac  staff    160  8  6 21:57 .vscode

# 환경변수 입력
echo 'export PATH="/opt/homebrew/bin:$PATH"' >> ~/.bash_profile
# 환경 변수 적용
source ~/.bash_profile

brew --version
Homebrew 4.3.17

음음~ 버전까지 잘 확인 됨

다음은  java 설치.
지금 17 버전을 쓰고 있어서 바로 17 명령어를 조진다
만약에 다른 버전이 필요 하면, 구글링 또는 아래 명령어로 서칭 후 설치

# open jdk 서칭을 위해서...
brew tap adoptopenjdk/openjdk # 설치

==> Tapping adoptopenjdk/openjdk
Cloning into '/opt/homebrew/Library/Taps/adoptopenjdk/homebrew-openjdk'...
remote: Enumerating objects: 2010, done.
remote: Counting objects: 100% (74/74), done.
remote: Compressing objects: 100% (29/29), done.
remote: Total 2010 (delta 54), reused 63 (delta 45), pack-reused 1936 (from 1)
Receiving objects: 100% (2010/2010), 376.49 KiB | 5.79 MiB/s, done.
Resolving deltas: 100% (1434/1434), done.
Tapped 47 casks (69 files, 526.7KB).

brew search jdk # 필요한 jdk 검색

# 하지만 난 건너 뛰고 바로 17버전 설치
brew install openjdk@17

If you need to have openjdk@17 first in your PATH, run:
  echo 'export PATH="/opt/homebrew/opt/openjdk@17/bin:$PATH"' >> /Users/user_mac/.bash_profile

For compilers to find openjdk@17 you may need to set:
  export CPPFLAGS="-I/opt/homebrew/opt/openjdk@17/include"
# 아무튼 설치 완료, 다음은 환경 변수

bash 기준 환경 변수는 아래처럼 설정 했다

# symlink 명령어 추가 먼저

sudo ln -sfn /opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-17.jdk
Password: # 맥북 비번

# 환경 변수 추가
echo 'export PATH="/opt/homebrew/opt/openjdk@17/bin:$PATH"' >> ~/.bash_profile

# 적용
source ~/.bash_profile

# 버전 확인쓰
java -version

openjdk version "17.0.12" 2024-07-16
OpenJDK Runtime Environment Homebrew (build 17.0.12+0)
OpenJDK 64-Bit Server VM Homebrew (build 17.0.12+0, mixed mode, sharing)

아무튼 세팅은 끝났고 이제 이클립스 설치 하러 가보자

반응형