--- tags: 拯救資工系學生的基本素養, vscode --- # VSCode 套件安裝 ![](https://i.imgur.com/lp3n6Vn.png) ## C 語言開發 ### MinGW * [mingw-get-setup.exe](https://zh-tw.osdn.net/dl/mingw/mingw-get-setup.exe) * mingw32-gcc-g++-bin * mingw32-gdb-bin * 檔案總管 > 電腦 > 內容 > 進階系統設定 > 環境變數 > Path 加入 `\MinGW\bin` ### 套件 * C/C++ (C/C++ 語言的支援) * C++ Intellisense * Code Runner ![](https://i.imgur.com/Tp8vGWb.png) :::info - [x] [C/C++ for Visual Studio Code](https://code.visualstudio.com/docs/languages/cpp) - [x] [Using GCC with MinGW](https://code.visualstudio.com/docs/cpp/config-mingw#_run-helloworldcpp) (create `task.json`) - [ ] [用 VSCode 寫 C/C++ 教學](https://hackmd.io/@liaojason2/vscodecppwindows) ::: ## Java 開發 ### Java Development Kit (JDK) * [Java SE Development Kit 16 Downloads](https://www.oracle.com/java/technologies/javase-jdk16-downloads.html) * [Java SE Runtime Environment 8 Downloads](https://www.oracle.com/tw/java/technologies/javase-jre8-downloads.html) * 檔案總管 > 電腦 > 內容 > 進階系統設定 > 環境變數 > 新增: `JAVA_HOME` `\Java\jdk-` * 檔案總管 > 電腦 > 內容 > 進階系統設定 > 環境變數 > Path 加入 `\Java\jdk-\bin` - 檢查是否安裝成功 ```shell $ java --version ``` ### Maven * [Downloading Apache Maven](https://maven.apache.org/download.cgi) > Binary zip archive * 檔案總管 > 電腦 > 內容 > 進階系統設定 > 環境變數 > Path 加入 `\Java\apache-maven-\bin` * 修改 `apache-maven-3.0.3\conf\settings.xml` 中存放 `*.jar` 的位址 ```xml <!-- localRepository | The path to the local repository maven will use to store artifacts. | | Default: ${user.home}/.m2/repository <localRepository>/path/to/local/repo</localRepository> --> <localRepository>/Java/localrepository</localRepository> ``` * 執行 ```shell $ mvn help:system ``` ### 套件 * Java Extension Pack * Jetty for Java * Tomcat for Java * Spring Boot Extension Pack ![](https://i.imgur.com/nBRYxG2.png) ![](https://i.imgur.com/qwQcWOH.png) ![](https://i.imgur.com/fzgQMSu.png) ![](https://i.imgur.com/LyxbGll.png) ### 設定 * 左下角齒輪 > 設定 > 搜尋: `maven` ![](https://i.imgur.com/9HPJqaU.png) ### 建立 Java 專案 * 建立 Maven 專案 ![](https://i.imgur.com/XsJ3VXv.png) * 導入第三方 `*.jar` ![](https://i.imgur.com/kUnthoI.png) ## Python 開發 - [ ] [使用 Visual Studio Code 設定您的 Python 初學者開發環境](https://docs.microsoft.com/zh-tw/learn/modules/python-install-vscode/) ## Remote - WSL ![](https://i.imgur.com/Nrc7vfG.png) ### WSL * [Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/windows/wsl) ### 套件 * Remote - WSL ![](https://i.imgur.com/3IU2Pwl.png) ### 啟動功能 1. open PowerShell as an Administrator and type: ```shell Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux ``` 2. new Status bar item | | | |:------------------------------------:|:------------------------------------:| | ![](https://i.imgur.com/JgDBRYv.png) | ![](https://i.imgur.com/Wh6b9Ly.png) | 或在 shell 上輸入 `$ code .` ,也可開啟 VSCode :::info - [ ] [Remote development in WSL](https://code.visualstudio.com/docs/remote/wsl-tutorial) ::: ## Remote - SSH ![](https://i.imgur.com/X2dj7EA.png) ### SSH client | OS | Instructions | |:---------------------- |:--------------------------------------------------------------------------------------------------------------- | | Windows 10 | [安裝 OpenSSH](https://docs.microsoft.com/zh-tw/windows-server/administration/openssh/openssh_install_firstuse) | | macOS | Comes pre-installed. | | Debian/Ubuntu | `$ sudo apt-get install openssh-client` | | RHEL / CentOS | `$ sudo yum install openssh-clients` | - [ ] [Quick start: Using SSH keys](https://code.visualstudio.com/docs/remote/troubleshooting#_quick-start-using-ssh-keys) ### SSH server | OS | Instructions | |:---------------------- |:--------------------------------------------------------------------------------------------------------------- | | Windows 10 | [安裝 OpenSSH](https://docs.microsoft.com/zh-tw/windows-server/administration/openssh/openssh_install_firstuse) | | macOS | [允許遠端電腦取用您的 Mac](https://support.apple.com/zh-tw/guide/mac-help/mchlp1066/mac) | | Debian/Ubuntu | `$ sudo apt-get install openssh-server` | | RHEL / CentOS | `$ sudo yum install openssh-server && sudo systemctl start sshd.service && sudo systemctl enable sshd.service` | ### 套件 * Remote - SSH ![](https://i.imgur.com/45QLjXa.png) ### 連接 SSH Server :::info - [ ] [Remote Development using SSH](https://code.visualstudio.com/docs/remote/ssh) ::: 1. 在 VSCode 按下 `Ctrl+Shift+P`,並選擇 **Remote-SSH: Connect to Host...** 2. 輸入 `<username>@<host>:<port>` ![](https://i.imgur.com/FgZ6zwp.png) 3. 選擇主機的平台 ![](https://i.imgur.com/DIFUEnz.png)