Skip to content

Commit e69ad03

Browse files
Add Java getting started page for Windows dev environment
- Add hub/dev-environment/java.md covering JDK choice, winget install, JAVA_HOME configuration, WSL vs native, and recommended editors - Add Java entry to hub/dev-environment/toc.yml (after Python) - Add Java card to index.md development paths grid Note: hub/images/java-logo.png needs to be added for the card icon. Co-authored-by: Copilot <[email protected]>
1 parent 2925bc3 commit e69ad03

3 files changed

Lines changed: 90 additions & 1 deletion

File tree

hub/dev-environment/index.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,19 @@ Follow these guides to set up your development environment for your preferred la
7373
**[Get started with Python](./python.md)**<br>
7474
Install Python and set up your development environment on Windows.
7575
:::column-end:::
76+
:::column:::
77+
[![Java icon](../images/java-logo.png)](./java.md)<br>
78+
**[Get started with Java](./java.md)**<br>
79+
Install a JDK, configure JAVA_HOME, and set up your Java development environment on Windows.
80+
:::column-end:::
81+
:::row-end:::
82+
83+
:::row:::
7684
:::column:::
7785
[![C / C++](../images/c-logo.png)](/cpp/)<br>
7886
**[Get started with C++ and C](/cpp/)**<br>
7987
Develop apps, services, and tools with C++, C, and assembly.
8088
:::column-end:::
81-
:::row-end:::
8289

8390
:::row:::
8491
:::column:::

hub/dev-environment/java.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
title: Get started with Java on Windows
3+
description: A guide to help you set up a Java development environment on Windows, including JDK installation, JAVA_HOME configuration, and recommended tools.
4+
ms.topic: get-started
5+
ms.subservice: windows-nodejs
6+
ms.date: 03/27/2026
7+
---
8+
9+
# Get started with Java on Windows
10+
11+
This guide covers what's different about setting up Java on Windows compared to Mac or Linux, and gets you to a working JDK installation with your environment configured correctly.
12+
13+
## Choose a JDK
14+
15+
Several JDK distributions are available for Windows. Microsoft publishes its own build based on OpenJDK:
16+
17+
- **[Microsoft Build of OpenJDK](https://www.microsoft.com/openjdk)** — free, open source, supported by Microsoft, available for Windows x64 and ARM64
18+
- **[Eclipse Temurin (Adoptium)](https://adoptium.net/)** — widely used open-source distribution
19+
- **[Oracle JDK](https://www.oracle.com/java/technologies/downloads/)** — requires a license for commercial use
20+
21+
For most developers, Microsoft Build of OpenJDK or Temurin are good choices.
22+
23+
## Install with winget
24+
25+
Open a PowerShell or Command Prompt terminal and run:
26+
27+
```powershell
28+
winget install Microsoft.OpenJDK.21
29+
```
30+
31+
To install Temurin instead:
32+
33+
```powershell
34+
winget install EclipseAdoptium.Temurin.21.JDK
35+
```
36+
37+
Verify the installation:
38+
39+
```powershell
40+
java -version
41+
```
42+
43+
## Set JAVA_HOME
44+
45+
Unlike on macOS (where `/usr/libexec/java_home` handles this), on Windows you need to set `JAVA_HOME` manually. Many tools — Maven, Gradle, Android Studio — require it.
46+
47+
1. Open **Start**, search for **Environment Variables**, and select **Edit the system environment variables**.
48+
2. Click **Environment Variables**.
49+
3. Under **System variables**, click **New** and set:
50+
- Variable name: `JAVA_HOME`
51+
- Variable value: the path to your JDK, for example `C:\Program Files\Microsoft\jdk-21.0.x.x-hotspot`
52+
4. Find the **Path** variable under System variables, click **Edit**, and add `%JAVA_HOME%\bin`.
53+
5. Click OK to close all dialogs, then open a new terminal and verify:
54+
55+
```powershell
56+
echo $env:JAVA_HOME
57+
java -version
58+
javac -version
59+
```
60+
61+
> [!TIP]
62+
> If you have multiple JDKs installed, the one listed first in `Path` takes precedence. Tools like [SDKMAN](https://sdkman.io/) (via WSL) or [jEnv](https://www.jenv.be/) can help manage multiple versions.
63+
64+
## WSL or native Windows?
65+
66+
For most Java development — web backends, Android, enterprise apps — native Windows works well. Use WSL if your build tooling or deployment target is Linux-specific, or if you're working in a team where everyone else is on Linux/Mac and you want environment parity.
67+
68+
## Recommended editors
69+
70+
- **[Visual Studio Code](https://code.visualstudio.com/)** with the [Extension Pack for Java](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack) — lightweight, works well for most projects
71+
- **[IntelliJ IDEA](https://www.jetbrains.com/idea/)** — full-featured IDE, the Community edition is free
72+
73+
## Next steps
74+
75+
> [!div class="nextstepaction"]
76+
> [Learn Java (java.com)](https://dev.java/learn/)
77+
78+
- [Maven in 5 minutes](https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html)
79+
- [Gradle quickstart](https://docs.gradle.org/current/userguide/getting_started_eng.html)
80+
- [Java in Visual Studio Code](https://code.visualstudio.com/docs/languages/java)

hub/dev-environment/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ items:
136136
href: ./javascript/vue-on-windows.md
137137
- name: Get started with Python
138138
href: ./python.md
139+
- name: Get started with Java
140+
href: ./java.md
139141
- name: Get started with C and C++
140142
href: /cpp/
141143
- name: Get started with C#

0 commit comments

Comments
 (0)