Posts ๐Ÿ’ป [Computer Basic] ๐Ÿ˜Ž๊ฐœ๋ฐœ์ž๋ฅผ ์œ„ํ•œ Windows ๊ฐœ๋ฐœํ™˜๊ฒฝ ์„ธํŒ…
Post
Cancel

๐Ÿ’ป [Computer Basic] ๐Ÿ˜Ž๊ฐœ๋ฐœ์ž๋ฅผ ์œ„ํ•œ Windows ๊ฐœ๋ฐœํ™˜๊ฒฝ ์„ธํŒ…

๐Ÿ˜Ž ๊ฐœ๋ฐœ์ž๋ฅผ ์œ„ํ•œ Windows ๊ฐœ๋ฐœํ™˜๊ฒฝ ์„ธํŒ…



#1 ๊ธฐ๋ณธ ์…‹์—…



1.0 PC ํฌ๋งท ํ›„ ๋“œ๋ผ์ด๋ฒ„ ์žก๊ธฐ (3DP chip ์ด์šฉ)

1.1 Chocolatey ์„ค์น˜ ํ›„ ํ•„์š” ํŒจํ‚ค์ง€ ๋‹ค์šด๋กœ๋“œ(Windows PowerShell ์„ค์น˜)

1
2
3
4
5
6
7
8
#1.1.1
ํŒจํ‚ค์ง€: Chrome, VSC, Python, Windows Terminal, Git

#1.1.2
VSC Extensions: Prettier, Material Theme(+icons), Java Extensions, Python, Tab Out

#1.1.3
๊ทธ์™ธ: Java SE(JDK)- ์˜ค๋ผํด ๊ณตํ™ˆ / WSL-MS / Ubuntu- MS Store

1.2 WSL (Windows Subsystems for Linux) ์…‹์—…

1
2
3
4
5
#1.2.1
<https://docs.microsoft.com/ko-kr/windows/wsl/install-win10>

#1.2.2
WSL ๊ธฐ๋ณธ ์„ค์น˜ + ์ปค๋„ ์—…๋ฐ์ดํŠธ + WSL 2 ์—…๋ฐ์ดํŠธ

1.3 ๋ฉ”์ธ๋ณด๋“œ ๊ฐ€์ƒํ™”(Virtual Machine) ์…‹์—…

1
2
3
4
5
#1.3.1
Asus Prime X470 ๊ธฐ์ค€ BIOS ์„ธํŒ… ์ง„์ž… ํ›„ Advanced ๋ชจ๋“œ

#1.3.2
Advanced - CPU Configuration - SVM - Enabled๋กœ ๋ณ€๊ฒฝ

1.4 Ubuntu ์…‹์—…

1
2
3
4
5
6
7
8
#1.4.1
Ubuntu ์ธ์Šคํ†จ ํ›„ ์œ ์ € ์ด๋ฆ„, ํŒจ์Šค์›Œ๋“œ ์„ค์ •

#1.4.2
wsl --set-version Ubuntu๋ฒ„์ „ 2 ์ž…๋ ฅ(์šฐ๋ถ„ํˆฌ์—์„œ wsl2๋ฅผ ๊ธฐ๋ณธ์œผ๋กœ ์‚ฌ์šฉํ•˜๋„๋ก ์„ค์ •)

#1.4.3
Windows Terminal ์—์„œ ๊ธฐ๋ณธ ํ„ฐ๋ฏธ๋„์„ Ubuntu๋กœ ์„ค์ • ํ›„ ๋ฆฌ๋ถ“



#2 ์ปค์Šคํ„ฐ๋งˆ์ด์ง•



2.1 oh my zsh

1
2
3
4
5
6
7
8
9
10
11
#2.1.1
[http://github.com/ohmyzsh/ohmyzsh](http://github.com/ohmyzsh/ohmyzsh) ์—์„œ zsh ๋‹ค์šด๋กœ๋“œ>> sudo apt install zsh ์‰˜์ž…๋ ฅ

#2.1.2 sh -c
"$(wget -O- [https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh](https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh))" ์‰˜์ž…๋ ฅ

#2.1.3
์„ค์น˜ ์™„๋ฃŒ ํ›„ code ์ž…๋ ฅํ•˜์—ฌ Ubuntu์— VSC ์„œ๋ฒ„ ์—ฐ๊ฒฐ

#2.1.4
์ด์ œ Ubuntu ์—์„œ ๋ฐ”๋กœ VSC๋ฅผ ์—ฐ๊ฒฐํ•  ์ˆ˜ ์žˆ๋‹ค!

2.2 color scheme setup

1
2
3
4
5
6
7
8
9
10
11
12
#2.2.1
[msdocs ์•ˆ๋‚ด](https://docs.microsoft.com/ko-kr/windows/terminal/customize-settings/color-schemes) ํ…Œ๋งˆ๋ฅผ ์“ฐ๊ฑฐ๋‚˜

#2.2.2
[terminalsplash.com/?ref=producthunt](http://terminalsplash.com/?ref=producthunt) ์—์„œ Terminal Splash๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Œ

#2.2.3
.JSON ํŒŒ์ผ์˜ color scheme ๊ฐ’์„ ์ง์ ‘ ์ˆ˜์ •ํ•˜์—ฌ ์ปค์Šคํ„ฐ๋งˆ์ด์ง• ํ•  ๊ฒƒ

> > ๋ชจ๋“  ์‰˜์— ๊ฐ™์€ ํ…Œ๋งˆ๋ฅผ ์“ฐ๊ณ  ์‹ถ์€ ๊ฒฝ์šฐ

     "profiles"์˜ "defaults"์— "colorschome": "ํ…Œ๋งˆ", ๋ฅผ ๋„ฃ์–ด์ค„ ๊ฒƒ

2.3 powerlevel10k

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#2.3.1
๋” ์พŒ์ ํ•œ ํ™˜๊ฒฝ์„ ์œ„ํ•ด powerlevel10k ์‚ฌ์šฉ (oh my zsh ์จ์„œ ์„ค์น˜)

#2.3.2
[https://github.com/romkatv/powerlevel10k#oh-my-zsh](https://github.com/romkatv/powerlevel10k#oh-my-zsh) ์—์„œ git clone ๋ณต์‚ฌ ํ›„ ๋ถ™์—ฌ๋„ฃ๊ธฐ

#2.3.3
.zshrc ํŒŒ์ผ ์ˆ˜์ • (๋ช…๋ น์–ด: code ~/.zshrc)>> ๋””ํดํŠธ๋ฅผ powerlevel10k/powerlevel10k ๋กœ ๋ณ€๊ฒฝ

#2.3.4
ํ„ฐ๋ฏธ๋„ ์žฌ์‹œ์ž‘ ํ›„ Powerlevel10 Configuration wizard ์ง„ํ–‰

#2.3.5
MesloLGS NF ํฐํŠธ ์„ค์น˜(Regualr, Bold, Italic, Bold Italic)

#2.3.6
ํฐํŠธ๊ฐ€ ๊นจ์ ธ๋ณด์ด๋Š” ๊ฒฝ์šฐ, ํ„ฐ๋ฏธ๋„ ์„ธํŒ…(.JSON) ์—์„œ
"defaults" ๊ฐ’์— "fontFace": "MesloLGS NF" ์ถ”๊ฐ€

#2.3.7
VSC Preferences > Terminal > Integrated - Font Family ์ฐพ์•„ MesloLGS NF ๊ธฐ๋ณธํฐํŠธ๋กœ ์„ค์ •

#2.3.8
Powelevel10k ์„ค์ • ๋งˆ๋ฌด๋ฆฌ

2.4 ls color change

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#2.4.1
์‰˜์—์„œ code ~./zshrc ๋กœ ์„ค์ •ํŒŒ์ผ ์—ด์–ด์ฃผ๊ธฐ

#2.4.2
๋งˆ์ง€๋ง‰ ๋ผ์ธ์— LS_COLORS="ow=01;36;40" && export LS_COLORS ์ถ”๊ฐ€ (wsl ๊ธฐ๋ณธ ls ์ปฌ๋Ÿฌ๋ฅผ ๋ณ€๊ฒฝ)

#2.4.3
VSC settings > intergrated terminal > automationsShell Windows Edit.JSON ์—ด๊ณ 

#2.4.4
"terminal.integrated.automationShell.windows": "C:\\Windows\\System32\\wsl.exe" ์ถ”๊ฐ€

#2.4.5
์ €์žฅ ํ›„ ํ„ฐ๋ฏธ๋„ ์ฐฝ ์—ฐ ๋’ค powershell๋กœ ์„ ํƒ๋˜์–ด์žˆ๋Š” ํ„ฐ๋ฏธ๋„์„ ๐Ÿ”ฝ ๋ˆŒ๋Ÿฌ์„œ Ubuntu(WSL)๋กœ ๋ณ€๊ฒฝ

https://nomadcoders.co/windows-setup-for-developers/lectures/1836



#3 ์„ค์น˜



3.1 ๋ฆฌ๋ˆ…์Šค ๋ช…๋ น์–ด

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
$ ls
// ๋””๋ ‰ํ† ๋ฆฌ ์ถœ๋ ฅ(list)

$ cd ..
// ์ƒ์œ„ํด๋”๋กœ ์ด๋™

$ cd
// ๋””๋ ‰ํ† ๋ฆฌ ์ด๋™

$ touch helloworld.java
// .java ํŒŒ์ผ ์ƒ์„ฑ

$ touch something/else.java
// ํ˜„์žฌ ์œ„์น˜์— something ๋””๋ ‰ํ† ๋ฆฌ ์ƒ์„ฑ ํ›„ ๊ทธ ์•ˆ์— else.java ์ƒ์„ฑ

$ mkdir new_project
// ํ˜„์žฌ ์œ„์น˜์— new_project ๋””๋ ‰ํ† ๋ฆฌ ์ƒ์„ฑ

$ mv file.java to_new_file.java
// file.java์˜ ์ด๋ฆ„์„ new_file.java ๋กœ ๋ณ€๊ฒฝ

$ mv /foldername /home/yon/java
// fordername ๋””๋ ‰ํ† ๋ฆฌ๋ฅผ /home/yon/java ๋กœ ์˜ฎ๊ธฐ๊ธฐ

$ rm something/file.java
// something ๋””๋ ‰ํ† ๋ฆฌ ๋‚ด์˜ file.java ์‚ญ์ œ

$ rm -rf something
// something ๋””๋ ‰ํ† ๋ฆฌ๋ฅผ ์‚ญ์ œํ•˜๊ธฐ

$ exit()
// ํ”„๋กœ๊ทธ๋žจ ์ข…๋ฃŒ

$ sudo
// root ๊ถŒํ•œ ๋ถ€์—ฌ(admin)

$ ํ”„๋กœ๊ทธ๋žจ๋ช… -v
// ํ”„๋กœ๊ทธ๋žจ ๋ฒ„์ „ ํ™•์ธ

$ code ~/.zshrc
// ์šฐ๋ถ„ํˆฌ ์ฝ˜์†” ์„ค์ •
// .zshrc ํŒŒ์ผ์— alias python=python3.8 ๋ช…๋ น์–ด๋ฅผ ์ถ”๊ฐ€ํ•˜๋ฉด
// ํŒŒ์ด์ฌ์„ ์‹คํ–‰ํ•  ๋•Œ ๊ธฐ๋ณธ์ ์œผ๋กœ 3.8 ๋ฒ„์ „์„ ์‹คํ–‰ํ•œ๋‹ค

$ sudo tar xvf /ํŒŒ์ผ๋ช….tar.gz
// .tar ํŒŒ์ผ์˜ ์••์ถ•์„ ํ’€์–ด์ฃผ๋Š” ๋ช…๋ น์–ด -์˜ค๋ผํด Java ์„ค์น˜ํ•  ๋•Œ ์‚ฌ์šฉํ–ˆ์Œ

$ sudo vi /etc/profile
// ํ™˜๊ฒฝ์„ค์ • ์ง„ํ–‰

$ mkdir new_project
// ํ˜„์žฌ ์œ„์น˜์— new_project ๋””๋ ‰ํ† ๋ฆฌ ์ƒ์„ฑ

๐Ÿ’™ ์œˆ๋„์šฐ์—์„œ WSL๋ฅผ ์ด์šฉํ•˜๋Š” ๊ฒฝ์šฐ, ์œ ์ €๋Š” ์ž‘์—… ๋ฐฉ์‹์„ ์„ ํƒํ•  ์ˆ˜ ์žˆ๋‹ค.

1
2
    1. ํ”„๋กœ์ ํŠธ์™€ ๋ชจ๋“  ์†Œ์Šค์ฝ”๋“œ๋ฅผ ์œˆ๋„์šฐ ํ•˜๋“œ๋“œ๋ผ์ด๋ธŒ์— ์ €์žฅํ•˜๊ฑฐ๋‚˜(Window side)
    2. ํ”„๋กœ์ ํŠธ์™€ ๋ชจ๋“  ์†Œ์Šค์ฝ”๋“œ๋ฅผ ๋ฆฌ๋ˆ…์Šค Home ๋””๋ ‰ํ† ๋ฆฌ์— ์ €์žฅํ•˜๊ฑฐ๋‚˜(Linux side)

๐Ÿ’™ ์ฃผ์˜ํ•  ์ 

1
2
3
4
    Linux ์—์„œ๋Š” ์œˆ๋„์šฐ ํŒŒ์ผ์— ์ ‘๊ทผํ•˜์—ฌ ๋ฌด์–ธ๊ฐ€๋ฅผ ๊ฑด๋“œ๋ ค๋ณผ ์ˆ˜ ์žˆ์ง€๋งŒ,
    ๋ฐ˜๋Œ€๋กœ ์œˆ๋„์šฐ์—์„œ Linux์— ๋ณด๊ด€ํ•ด๋‘” ํŒŒ์ผ์— ์ ‘๊ทผํ•˜์—ฌ ๋ฌด์–ธ๊ฐ€๋ฅผ ๊ฑด๋“œ๋ฆฌ๋ ค๋Š” ์ˆœ๊ฐ„ ๊ฐ์ข… ์ถฉ๋Œ์„ ๋งŒ๋‚˜๊ฒŒ ๋œ๋‹ค.
    ๋”ฐ๋ผ์„œ ์œˆ๋„์šฐ์—์„œ๋Š” ๊ทธ ์–ด๋–ค ๋ฆฌ๋ˆ…์Šค ํŒŒ์ผ๋„ ๊ฑด๋“œ๋ฆฌ์ง€ ์•Š๋Š” ๊ฒƒ์ด ์ข‹๋‹ค.
    ๋”ฐ๋ผ์„œ ๋˜๋„๋ก ํ”„๋กœ์ ํŠธ์™€ ์†Œ์Šค์ฝ”๋“œ ํŒŒ์ผ์€ ์œˆ๋„์šฐ์— ๋ณด๊ด€ํ•˜๊ณ  Linux์—์„œ ์ ‘๊ทผํ•˜์—ฌ ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ์‹์œผ๋กœ ์ž‘์—…์„ ์ง„ํ–‰ํ•˜๋Š” ๊ฒƒ์„ ๊ถŒ์žฅํ•œ๋‹ค.



3.2 apt(apt ๋ช…๋ น์–ด๋Š” ํŒจํ‚ค์ง€๋ฅผ ๋‹ค์šด๋กœ๋“œ ํ•  ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋ฅผ ๊ฒ€์ƒ‰ํ•ด๋ณด๊ฒŒ ๋งŒ๋“ ๋‹ค.)


1
2
3
4
5
6
7
8
9
10
$ apt-get install ํ”„๋กœ๊ทธ๋žจ๋ช…
// ํ”„๋กœ๊ทธ๋žจ ์„ค์น˜ํ•˜๊ธฐ (ubuntu install ๋กœ ๊ตฌ๊ธ€๋งํ•˜์—ฌ ํ•„์š”ํ•œ ํ”„๋กœ๊ทธ๋žจ ๋‹ค์šด)
// apt ๋Š” ํŒจํ‚ค์ง€๋ฅผ ๋‹ค์šด๋กœ๋“œ ํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋งŒ๋“ค์–ด์ค€๋‹ค(DB๋ฅผ ์ฐพ์Œ)

$ apt-get upgrade
// ํŒจํ‚ค์ง€ ์—…๊ทธ๋ ˆ์ด๋“œ

$ apt-get update
// apt-get ์ด ์ฐพ์•„๋ณผ ์ˆ˜ ์žˆ๋Š” ํ”„๋กœ๊ทธ๋žจ๋“ค์˜ DB๋ฅผ ์—…๋ฐ์ดํŠธ ํ•˜๋Š” ๋ช…๋ น์–ด



#4 Java ์„ค์น˜



4.1 ๋ฆฌ๋ˆ…์Šค ์„œ๋ฒ„์— Java ์„ค์น˜ํ•˜๊ธฐ

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
$ sudo apt-get update
// (1) apt ์—…๋ฐ์ดํŠธ

$ sudo apt-get install openjdk-11-jdk
// (2) openjdk 11 ์„ค์น˜

$ java -version
// (3) ์„ค์น˜์—ฌ๋ถ€ ํ™•์ธ

$ sudo update-alternatives --config java
// (4) ์—…๋ฐ์ดํŠธ

$ which javac
// (5) ์ž๋ฐ” ์„ค์น˜ํด๋” ์œ„์น˜ ๋ฆฌํ„ด

$ readlink -f $(which javac)
// (6) javac์˜ ์‹ค์ œ ํŒŒ์ผ ๊ฒฝ๋กœ๋ฅผ ๋ฆฌํ„ด - ์ด ๊ฒฝ๋กœ๋ฅผ ๊ธฐ์ค€์œผ๋กœ ํ™˜๊ฒฝ๋ณ€์ˆ˜๋ฅผ ์„ค์ •(์ปดํŒŒ์ผ๋Ÿฌ ๊ฒฝ๋กœ ์„ค์ •)
// ex) /usr/lib/jvm/java-11-openjdk-amd64

$ sudo nano /etc/profile
// (7) ๋‚˜๋…ธ ํŽธ์ง‘๊ธฐ๋ฅผ ์ด์šฉํ•˜์—ฌ ์ปดํŒŒ์ผ๋Ÿฌ ๊ฒฝ๋กœ๋ฅผ ์„ค์ •ํ•ด์ค€๋‹ค.

(8) ๋‚˜๋…ธ ํŽธ์ง‘๊ธฐ์˜ ๋งˆ์ง€๋ง‰ ์ค„์— JAVA_HOME,PATH,CLASS_PATH ๊ฒฝ๋กœ๋ฅผ ์ถ”๊ฐ€ํ•ด์ค€๋‹ค

$ export JAVA_HOME=(6) ์—์„œ ๋ฆฌํ„ด๋œ ๊ฒฝ๋กœ ex)  /usr/lib/jvm/java-11-openjdk-amd64
$ export PATH=$JAVA_HOME/bin/:$PATH
$ export CLASS_PATH=$JAVA_HOME/lib:$CLASS_PATH

(9) ctrl + o ๋กœ ์„ธ์ด๋ธŒํ•˜๊ณ  ctrl + x ๋กœ ํŽธ์ง‘๊ธฐ๋ฅผ ๋น ์ ธ๋‚˜์˜จ ๋’ค ์šฐ๋ถ„ํˆฌ ์žฌ์‹คํ–‰

(10) $ java -version ๋ฐ $ javac -version ์œผ๋กœ ๋ฒ„์ „ ์ถœ๋ ฅ์ด ์ œ๋Œ€๋กœ ๋˜๋Š”์ง€ ํ™•์ธ

(11) ์ด์ œ VSC-WSL ํ™˜๊ฒฝ์—์„œ Java๋ฅผ ์ปดํŒŒ์ผ ํ•  ์ˆ˜ ์žˆ๋‹ค!

// ref: https://www.youtube.com/watch?v=-ea_gSFJ4Tg



#5 Git ์„ค์น˜



5.1 ๋ฆฌ๋ˆ…์Šค ์„œ๋ฒ„์— Git ์„ค์น˜ํ•˜๊ธฐ

1
2
3
4
5
6
7
8
9
10
11
12
13
$ sudo apt-get install git
$ sudo apt install git
// (1) git ์„ค์น˜

$ git --version
// (2) ์„ค์น˜๋œ git ๋ฒ„์ „ ํ™•์ธ(๋ฒ„์ „๋ช…์ด ๋œจ๋ฉด ์ •์ƒ)

$ git config --global user.name "๊นƒํ—ˆ๋ธŒ ๊ณ„์ •"
$ git config --global user.email "์ด๋ฉ”์ผ"
// (3) ์œ ์ € ์„ค์ •

$ git clone (์›ํ•˜๋Š” ๋ฆฌํฌ์ง€ํ† ๋ฆฌ ์ฃผ์†Œ)
// (4) ํ˜„์žฌ ์œ„์น˜์— ๋ฆฌํฌ์ง€ํ† ๋ฆฌ ๋ณต์ œ


5.2 ๋ฆฌ๋ˆ…์Šค ์„œ๋ฒ„์— Git CLI ์„ค์น˜ํ•˜๊ธฐ

1
2
3
4
5
6
7
8
9
10
11
๋งํฌ: https://github.com/cli/cli/blob/trunk/docs/install_linux.md#debian-ubuntu-linux-apt

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0
sudo apt-add-repository https://cli.github.com/packages
sudo apt update
sudo apt install gh

์ดํ›„ ๋ฒ„์ „ ์—…๊ทธ๋ ˆ์ด๋“œ๋Š”
sudo apt update
sudo apt install gh

This post is licensed under CC BY 4.0 by the author.

โ˜•๏ธ [Java] 30์ผ ์•ˆ์— ๊ธฐ์ดˆ ๋–ผ๊ธฐ/ DAY-08

๐Ÿ‹๏ธโ€โ™‚๏ธ [Workout Log] 2021-05-18