Skip to content

Commit d9f7a26

Browse files
Merge pull request #6562 from MicrosoftDocs/jken/revise-dev-environment-landing
Add Java getting started page for Windows dev environment
2 parents 5cd5089 + 6ca2ec2 commit d9f7a26

4 files changed

Lines changed: 91 additions & 2 deletions

File tree

hub/dev-environment/index.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
title: Windows developer tools
33
description: Windows includes built-in tools designed for developers — a package manager, a Linux subsystem, optimized storage, and more.
44
ms.topic: overview
5-
ms.subservice: windows-nodejs
65
ms.date: 03/26/2026
76
---
87

@@ -73,12 +72,19 @@ Follow these guides to set up your development environment for your preferred la
7372
**[Get started with Python](./python.md)**<br>
7473
Install Python and set up your development environment on Windows.
7574
:::column-end:::
75+
:::column:::
76+
[![Java icon](../images/java-logo.png)](./java.md)<br>
77+
**[Get started with Java](./java.md)**<br>
78+
Install a JDK, configure JAVA_HOME, and set up your Java development environment on Windows.
79+
:::column-end:::
80+
:::row-end:::
81+
82+
:::row:::
7683
:::column:::
7784
[![C / C++](../images/c-logo.png)](/cpp/)<br>
7885
**[Get started with C++ and C](/cpp/)**<br>
7986
Develop apps, services, and tools with C++, C, and assembly.
8087
:::column-end:::
81-
:::row-end:::
8288

8389
:::row:::
8490
:::column:::

hub/dev-environment/java.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
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.date: 03/27/2026
6+
---
7+
8+
# Get started with Java on Windows
9+
10+
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.
11+
12+
## Choose a JDK
13+
14+
Several JDK distributions are available for Windows. Microsoft publishes its own build based on OpenJDK:
15+
16+
- **[Microsoft Build of OpenJDK](https://www.microsoft.com/openjdk)** — free, open source, supported by Microsoft, available for Windows x64 and ARM64
17+
- **[Eclipse Temurin (Adoptium)](https://adoptium.net/)** — widely used open-source distribution
18+
- **[Oracle JDK](https://www.oracle.com/java/technologies/downloads/)** — requires a license for commercial use
19+
20+
For most developers, Microsoft Build of OpenJDK or Temurin are good choices.
21+
22+
## Install with winget
23+
24+
Open a PowerShell or Command Prompt terminal and run:
25+
26+
```powershell
27+
winget install Microsoft.OpenJDK.21
28+
```
29+
30+
To install Temurin instead:
31+
32+
```powershell
33+
winget install EclipseAdoptium.Temurin.21.JDK
34+
```
35+
36+
Verify the installation:
37+
38+
```powershell
39+
java -version
40+
```
41+
42+
## Set JAVA_HOME
43+
44+
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.
45+
46+
1. Open **Start**, search for **Environment Variables**, and select **Edit the system environment variables**.
47+
2. Click **Environment Variables**.
48+
3. Under **System variables**, click **New** and set:
49+
- Variable name: `JAVA_HOME`
50+
- Variable value: the path to your JDK, for example `C:\Program Files\Microsoft\jdk-21.0.x.x-hotspot`
51+
4. Find the **Path** variable under System variables, click **Edit**, and add `%JAVA_HOME%\bin`.
52+
5. Click OK to close all dialogs, then open a new terminal and verify:
53+
54+
```powershell
55+
echo $env:JAVA_HOME
56+
java -version
57+
javac -version
58+
```
59+
60+
> [!TIP]
61+
> 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.
62+
63+
## WSL or native Windows?
64+
65+
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.
66+
67+
## Recommended editors
68+
69+
- **[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
70+
- **[IntelliJ IDEA](https://www.jetbrains.com/idea/)** — full-featured IDE, the Community edition is free
71+
72+
## Next steps
73+
74+
> [!div class="nextstepaction"]
75+
> [Java on Azure and Windows documentation](/java/)
76+
77+
- [Java for Beginners (video series)](https://learn.microsoft.com/shows/java-for-beginners/)
78+
- [Learn Java (java.com)](https://dev.java/learn/)
79+
- [Maven in 5 minutes](https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html)
80+
- [Gradle quickstart](https://docs.gradle.org/current/userguide/getting_started_eng.html)
81+
- [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#

hub/images/java-logo.png

2.59 KB
Loading

0 commit comments

Comments
 (0)