Skip to content

Commit ae6badd

Browse files
feat(windows): update Java & Node setup (#195)
1 parent a7d6520 commit ae6badd

File tree

1 file changed

+33
-8
lines changed

1 file changed

+33
-8
lines changed

content/setup/windows.md

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ prev: /setup
44
next: /guide/creating-a-project
55
contributors:
66
- rigor789
7+
- herefishyfish
78
---
89

910
## Setting up Windows for Android
@@ -18,10 +19,24 @@ Setting up the Android development environment can be daunting if you are new to
1819

1920
### Installing Node
2021

21-
To install **Node** we recommend using a node version manager, such as [nvm-windows](https://github.com/coreybutler/nvm-windows), [nvs](https://github.com/jasongin/nvs) or any other node version manager you prefer. In these docs we will be using **nvm-windows**, but feel free to use a different node version manager.
22+
To install **Node** we recommend using a node version manager, such as [nvm-windows](https://github.com/coreybutler/nvm-windows), [nvs](https://github.com/jasongin/nvs) or any other node version manager you prefer. In these docs we will be using [nvm-windows](https://github.com/coreybutler/nvm-windows), but feel free to use a different node version manager.
2223

23-
1. Follow the [install instructions in the nvm-windows repository](https://github.com/coreybutler/nvm-windows#installation--upgrades). We recommend using the installer, however if you have a more advanced understanding of your needs you may also go for the manual installation instead.
24-
2. Run and follow the `nvm-setup.exe` instructions.
24+
1. Install [nvm-windows](https://github.com/coreybutler/nvm-windows) using one of the following methods:
25+
::: code-group
26+
27+
```bash [Chocolatey]
28+
choco install -y nvm
29+
```
30+
31+
```text [Installer Instructions]
32+
https://github.com/coreybutler/nvm-windows#installation--upgrades
33+
```
34+
35+
:::
36+
2. After installation, open a new Command Prompt and verify:
37+
```bash
38+
nvm version
39+
```
2540
3. Once the installation is complete, open a new Command Prompt and verify you can run `nvm ls`.
2641
4. Install the latest Node release with:
2742
```bash
@@ -46,7 +61,7 @@ If any of the above failed, we recommend checking out the [Microsoft Docs for Se
4661
To install a **JDK** (using the prebuilt OpenJDK binaries from [Adoptium](https://adoptium.net/)) open an Administrator Command Prompt (right click and select "Run as Administrator") and run the following command:
4762

4863
```bash
49-
choco install -y temurin17
64+
choco install -y temurin21
5065
```
5166

5267
Once installed, you might need to add it to your `Path`. First, check if you need to add it to your `Path` by opening a new Command Prompt and running the following:
@@ -60,10 +75,10 @@ If you see a version number printed, you may skip this step. Otherwise, you will
6075
1. Search for "**Edit the system environment variables**" in Windows Search and select
6176
2. Click on "**Environment variables...**" in the bottom corner
6277
3. Under the "**User variables for...**" select the **Path** variable and click **Edit...**
63-
4. Click **New** and add the **JDK binaries folder** path to the list.
64-
The default location is
78+
4. Click **New** and add the **JDK `bin` folder path** to the list.
79+
The **JDK** location may vary depending on the version you have installed.
6580
```
66-
C:\Program Files\Eclipse Adoptium\jdk-17.X.X\bin
81+
C:\Program Files\Eclipse Adoptium\jdk-21.0.9.10\bin
6782
```
6883

6984
Additionally, some installations may require creating the `JAVA_HOME` environment variable manually:
@@ -74,7 +89,7 @@ Additionally, some installations may require creating the `JAVA_HOME` environmen
7489
4. Add the following variable. Ensure you're using the correct JDK path, without the \bin suffix. Example:
7590
```
7691
VARIABLE_NAME: JAVA_HOME
77-
VARIABLE_VALUE: C:\Program Files\Eclipse Adoptium\jdk-17.0.12.7-hotspot
92+
VARIABLE_VALUE: C:\Program Files\Eclipse Adoptium\jdk-21.0.9.10-hotspot
7893
```
7994

8095
You may need to restart your terminal for changes to apply.
@@ -141,6 +156,16 @@ ns doctor android
141156

142157
If you see **No issues were detected** then you have successfully set up your system.
143158

159+
If you're using Chocolatey and prefer not to open a new terminal, you can refresh your environment variables in the current PowerShell session by running:
160+
161+
```bash
162+
Import-Module "$env:ChocolateyInstall/helpers/chocolateyInstaller.psm1"
163+
Update-SessionEnvironment
164+
```
165+
166+
After refreshing, run the `ns doctor` command again to confirm everything is working as expected.
167+
168+
144169
Lastly, you will also want to [set up an android device](/guide/running#enable-usb-debugging-on-android-devices) or [emulator](/guide/running#android-emulators).
145170

146171
::: warning Troubleshooting

0 commit comments

Comments
 (0)