Caution: VS Code guides section is a work-in-progress, containing content contributed by students.
This tutorial is adapted from the official VS Code Java Tutorial.
This guide will help you set up VS Code for Java development by installing the Java Development Kit (JDK), VS Code and the necessary extensions.
Before you can develop Java applications, you need to have a Java Development Kit (JDK) installed.
Check out our Java Installation guide for detailed installation and setup instructions for Windows, macOS, and Linux.
Note: After installing the Extension Pack for Java, VS Code Command Palette: / Ctrl+Shift+P
| Cmd+Shift+P
also offers a Java: Install New JDK
command to install and configure JDK versions through its integrated tools. However, we recommend following our Java Installation guide to install the JDK separately.
First time using VS Code?
Take a few minutes to explore the interface and try the built-in tutorials by opening the Command Palette: / Ctrl+Shift+P
| Cmd+Shift+P
and typing Welcome: Open Walkthrough
.
You can also refer to the official VS Code Getting Started guide for a comprehensive tutorial.
VS Code uses extensions to add programming language support and development tools. An extension pack is a bundle that contains multiple related extensions, making it easy to install everything you need for a specific programming language with just one click.
The Extension Pack for Java is Microsoft's official bundle that includes all the essential extensions for Java development. Instead of installing each extension individually, you can simply install this pack to get everything you need for Java development in VS Code.
Ctrl+Shift+X
| Cmd+Shift+X
Extension Pack for Java
Install
on the extension by MicrosoftTo verify that the Extension Pack for Java was installed correctly, open the Command Palette: / Ctrl+Shift+P
| Cmd+Shift+P
and type Java:
to see available commands
Contributors: John Wong (@Johnwz123)