If JDK, Gradle and Maven are already installed they will be used, otherwise they will be automatically installed in VS Code user directory. Environment variables such as JAVA_HOME and PATH do not need to be set. It also comes pre-included with extensions that most Java developers need, such as Spring Boot and Lombok, so you can start developing right out of the box with zero configuration.
- Click Install on the Marketplace web page in web browser
- Click Install on README opened in VS Code
- Open Extensions sideBar (Ctrl/CMD + Shift + X) in VS Code
- Search for
auto config - Click Install
- Open Quick Pick (Ctrl/CMD + P) in VS Code, paste the following command, and press enter.
ext install Pleiades.java-extension-pack-jdk
- Install from the command line.
code --install-extension Pleiades.java-extension-pack-jdk
Just install this extension and the JDK is auto-configured. Let's run the Java code right away!
- Open command palette (F1 or Ctrl/Cmd + Shift + P) >Java: Create Java Project...
- No build tools ≫ Specify project parent directory ≫ Enter new project name (e.g. HelloWorld)
- Open src/App.java ≫ Press F5 to debug run
- Create Hello World and run/debug (No build tools)
- Create a general Java project (No build tools / Gradle / Maven)
- Create a Spring Boot project (Gradle / Maven)
This extension adds available Java versions (Java 21 support) to a dropdown item in the VS Code Terminal. You can open a Terminal by clicking on the Java version you want to use and check the full version using commands below. The latest versions of gradle and mvn are available, but it is generally recommended to use wrappers (gradlew, mvnw) for each project.
java -version
gradle -v
mvn -vThe versions defined in java.configuration.runtimes are available.
(Enabling Java preview features)
| Project Type | Configuration |
|---|---|
| No build tools | settings.json > java.configuration.runtimes > default: true(Recommend Workspace Settings instead of User Settings) |
| Gradle | build.gradle > java > sourceCompatibility |
| Maven | pom.xml > properties > maven.compiler.source/target(Spring Boot: java.version) |
This extension has no specific settings or commands. As shown below, the JDK, build tools, terminal and other settings are automatically configured at start-up according to the current environment. If you are not interested in how it is auto-configured, you do not need to read the following.
Automatically configure multiple versions of the JDK and build tools. If there are multiple JDKs of the same version, the latest minor version among them is used. If you installed the JDK manually or encountered a configuration error, restart VS Code or execute Command Palette >Java: Clean Java Language Server Workspace ≫ Reload and Delete. These apply to User settings.json (VS Code global), but can be manually edited to customize them. If you want to customize your settings even further, consider using workspace settings or profiles.
- Auto-fix invalid JDK configuration (e.g.
/java/bin->/java) - Auto-remove configuration entries when JDK uninstalled or version path changed
- Auto-scan from packages SDKMAN, Homebrew, jEnv, jabba, ASDF, Gradle, Scoop, Chocolatey, IntelliJ etc...
- Auto-scan from installations Adoptium, BellSoft, Corretto, Microsoft, Oracle, Red Hat, Semeru, Zulu etc...
- Auto-detect environment variables
JAVA_HOME,JDK_HOMEandPATH - Auto-download Adoptium LTS JDKs, Gradle, Maven if not installed
- Auto-update auto-downloaded JDKs, Gradle, Maven to the latest version
The feature automatically fixes errors such as:
- Java Language Server requires a JDK xx+ to launch itself.
- This setting is deprecated, please use 'java.jdt.ls.java.home' instead.
- Invalid runtime for JavaSE-xx: The path points to a missing or inaccessible folder
- The java.jdt.ls.java.home variable defined in Visual Studio Code settings points to a missing or inaccessible folder
| Configuration Name | Configured Value (Priority Order) |
|---|---|
| Language support for Java | |
| Delete due to deprecated entry | |
| java.configuration.runtimes (Issues) |
Set all major JDKs scanned, detected, and downloaded (Setting > JAVA_HOME) |
| (*1) java.jdt.ls.java.home (Issues) |
(*2) Set stable LTS if unset, Fix if unsupported older version (Setting > Embedded JRE > JDK_HOME > JAVA_HOME > PATH) |
| Spring Boot Tools | |
| (*1) spring-boot.ls.java.home (Issues) |
(*2) Set stable LTS if unset, Fix if unsupported older version (Setting > JAVA_HOME > PATH) |
| Gradle for Java | |
| java.import.gradle.java.home (Issues) |
(*3) Set default if unset(Setting > java.jdt.ls.java.home) |
| java.import.gradle.home (Issues) |
Set latest gradle if not in PATH environment variable( gradlew > Setting > PATH > GRADLE_HOME) |
| Maven for Java | |
| maven.terminal.customEnv (Issues) |
(*3) Set default if JAVA_HOME environment variable unset(Setting > JAVA_HOME) |
| maven.executable.path (Issues) |
Set latest maven if not in PATH environment variable(Setting > mvnw > PATH) |
| Runtime Server Protocol UI | (No extension included) |
| (*1) rsp-ui.rsp.java.home (Issues) |
(*2) Set stable LTS if unset, Fix if unsupported older version (Setting > JDK_HOME > JAVA_HOME> Windows Registry > PATH) |
(*1) The language server runtime used by VS Code extensions. Not for building or running projects.
(*2) Usually the same version of the JDK as the Red Hat Java extension Embedded JRE.
(*3) The path in the entry marked as default:true in java.configuration.runtimes.
Automatic download is enabled if the extensions.autoUpdate configuration is NOT false. Java downloads multiple versions, but Gradle/Maven downloads only the latest version. If you use an older version of Gradle/Maven due to compatibility issues, please introduce gradlew (Compatibility) or mvnw (Compatibility) in your project or manually set java.import.gradle.home or maven.executable.path in settings.json.
- Adoptium JDK - Latest LTS 4 versions if not installed (VS Code supported versions)
- Gradle - Latest version if not in PATH environment variable
- Maven - Latest version if not in PATH environment variable
JDK auto-download supports the following platforms:
- Windows x64, ARM Emulation
- macOS x64, aarch64
- Linux x64, aarch64
It is saved in the following location.
| OS | Extension global storage location |
|---|---|
| Windows | %APPDATA%\Code\User\globalStorage\pleiades.java-extension-pack-jdk\ |
| macOS | $HOME/Library/Application Support/Code/User/globalStorage/pleiades.java-extension-pack-jdk/ |
| Linux | $HOME/.config/Code/User/globalStorage/pleiades.java-extension-pack-jdk/ |
Command Palette >Preferences: Open User Settings (JSON)
// JDT Language Server
"java.jdt.ls.java.home": "c:\\Program Files\\java\\jdk-17.0.6",
// ST4 Language Server
"spring-boot.ls.java.home": "c:\\Program Files\\java\\jdk-17.0.6",// Project Runtimes (multiple versions)
"java.configuration.runtimes": [
{
"name": "JavaSE-1.8", // Adoptium (Auto-download)
"path": "c:\\Users\\<UserName>\\AppData\\Roaming\\Code\\User\\globalStorage\\pleiades.java-extension-pack-jdk\\java\\8"
},
{
"name": "JavaSE-11", // Corretto (Auto-scan)
"path": "c:\\Program Files\\Amazon Corretto\\jdk11.0.18_10"
},
{
"name": "JavaSE-17", // Oracle (Auto-scan)
"path": "c:\\Program Files\\java\\jdk-17.0.6"
},
{
"name": "JavaSE-21", // Adoptium (Auto-scan)
"path": "c:\\Program Files\\Eclipse Adoptium\\jdk-21.0.1-hotspot",
"default": true // Runtime to use for No build tools projects
}
],
// Gradle Daemon
"java.import.gradle.java.home": "c:\\Program Files\\Eclipse Adoptium\\jdk-21.0.1-hotspot",
// Maven Default Environment Variables
"maven.terminal.customEnv": [
{
"environmentVariable": "JAVA_HOME", // Required for mvn command
"value": "c:\\Program Files\\Eclipse Adoptium\\jdk-21.0.1-hotspot"
}
],The terminal dropdown items by Java version are automatically created based on the "java.configuration.runtimes" above. You can easily open a terminal by selecting the Java version from command >Terminal: Create New Terminal (With Profile) or Terminal (Ctrl + `) ≫ Profiles dropdown. Besides java, gradle and mvn commands can also be used. The configured environment variables have no effect outside the terminal, so the system and OS user environment remain clean. The JAVA_HOME and PATH in the auto-configured terminal configuration will always be overridden from the configured runtimes, so if you want to customize it, copy the terminal configuration entry and create a new one.
| Configuration Name | Configured Value (Original Default) |
|---|---|
| terminal.integrated.env.* (Issues) |
Set default if JAVA_HOME environment variable unset (Setting > JAVA_HOME) |
| terminal.integrated.defaultProfile.windows (Issues) |
Set Command Prompt if unset on Windows( PowerShell) |
| terminal.integrated.profiles.* (Issues) |
Set configured runtimes to terminal (None) |
| terminal.integrated.enablePersistentSessions (Issues) |
false( true) |
| terminal.integrated.tabs.hideCondition (Issues) |
never( singleTerminal) |
A non-existent rcfile is specified so that JAVA_HOME and PATH are not overwritten at shell startup. If necessary, manually create the following rcfile.
| OS | Default Shell | rcfile Location |
|---|---|---|
| Windows | cmd | - |
| macOS | zsh | ~/.zsh_jdkauto/.zshrc |
| Linux or WSL | bash | ~/.bashrc_jdkauto |
Command Palette >Preferences: Open User Settings (JSON)
// Terminal Default Environment Variables
"terminal.integrated.env.windows": {
"JAVA_HOME": "c:\\Program Files\\Eclipse Adoptium\\jdk-21.0.1-hotspot",
"PATH": "c:\\Program Files\\Eclipse Adoptium\\jdk-21.0.1-hotspot\\bin;${env:PATH}"
},
// Terminal Default Profile
"terminal.integrated.defaultProfile.windows": "Command Prompt",
// Terminal Profiles Dropdown
"terminal.integrated.profiles.windows": {
"JavaSE-1.8": {
"path": "cmd",
"env": {
"JAVA_HOME": "c:\\Users\\<UserName>\\AppData\\Roaming\\Code\\User\\globalStorage\\pleiades.java-extension-pack-jdk\\java\\8",
"PATH": "c:\\Users\\<UserName>\\AppData\\Roaming\\Code\\User\\globalStorage\\pleiades.java-extension-pack-jdk\\java\\8\\bin;${env:PATH}"
},
"overrideName": true
},
"JavaSE-11": {
"path": "cmd",
"env": {
"JAVA_HOME": "c:\\Program Files\\Amazon Corretto\\jdk11.0.18_10",
"PATH": "c:\\Program Files\\Amazon Corretto\\jdk11.0.18_10\\bin;${env:PATH}"
},
"overrideName": true
},
"JavaSE-17": {
:
}Entries that do not have the following configuration in the user settings are automatically set to the default values of Auto Config Java. To prevent automatic setting, set the Original Default value below. Note that a debug run is required to enable Hot Code Replace (Hot Deploy).
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
"editor.rulers": [ // RGBA for transparency
{
"column": 80,
"color": "#00FF0010"
},
{
"column": 100,
"color": "#BDB76B15"
},
{
"column": 120,
"color": "#FA807219"
},
],
"workbench.colorCustomizations": {
"[Default Dark Modern]": {
"tab.activeBorderTop": "#00FF00",
"tab.unfocusedActiveBorderTop" : "#00FF0088",
"textCodeBlock.background": "#00000055", // Markdown preview code block
},
"editor.wordHighlightStrongBorder": "#FF6347", // Write-access
"editor.wordHighlightBorder": "#FFD700", // Read-access
"editor.selectionHighlightBorder": "#A9A9A9" // Double click selection
},The language pack corresponding to the OS locale is installed at the first startup.
cs,de,es,fr,it,ja,ko,pl,ru,tr,zh-hansorzh-hant
- MIT (c) 2023 Shinji Kashihara (cypher256) @ WILL
- Adoptium JDK: https://adoptium.net/docs/faq/#_is_temurin_free_to_use
A big thank you to the developers of VS Code and its extensions.
The Extension Pack for Java is required. Other extensions can be disabled or uninstalled according to your preference. Note that uninstalling this extension will uninstall all of the following extensions. If you want to set up extensions and configurations by development language, consider Profile. (*) indicates that it will be installed if available in that environment at first startup.
Extension Pack for Java (Microsoft: MIT, Red Hat: EPL) / VS Code Document
Java IntelliSense, debugging, testing, Maven/Gradle support, Lombok and more.Spring Boot Extension Pack (VMWare: EPL) / VS Code Document
A collection of extensions for developing Spring Boot applications.Gradle for Java (Microsoft: MIT) / VS Code Document
Manage Gradle Projects, run Gradle tasks and provide better Gradle file authoring experience in VS Code.XML (Red Hat: EPL)
XML Language Support by Red Hat (pom.xml etc.).Code Spell Checker (Street Side Software: GPL)
Spelling checker for source code.Todo Tree (Gruntfuggly: MIT)
Show TODO, FIXME, etc. comment tags in a tree view.Live Server (Ritwick Dey: MIT)
Launch a development local Server with live reload feature for static & dynamic pages.Trailing Spaces (Shardul Mahadik: MIT)
Highlight trailing spaces and delete them in a flash!Indent-Rainbow (oderwat: MIT)
Makes indentation easier to read.Rainbow CSV (mechatroner: MIT)
Highlight CSV and TSV files, Run SQL-like queries.(*) Comment Translate (intellsmi: MIT)
This plugin uses the Google Translate API to translate comments for the VS Code programming language.(*) Language Pack (Microsoft: MIT) / VS Code Document
A language pack that matches the OS Locale.
The following are not included but are very useful extensions. Try to install it if necessary.
Thunder Client (Ranga Vadhineni: Free)
Lightweight Rest API Client for VS Code.Error Lens (Phil Hindle: MIT)
Improve highlighting of errors, warnings and other language diagnostics.SonarLint (SonarSource: GPL) / VS Code Document
Detect and fix quality issues as you write code in C, C++, Java, JavaScript, PHP, Python, HTML and TypeScript.Checkstyle (ShengChen: GPL) / VS Code Document
Provide real-time feedback about Checkstyle violations and quick fix actions.Coverage Gutters (ryanluker: MIT)
Display test coverage generated by lcov or xml - works with many languages.thymeleaf (Juha Hinkula: Unknown)
Thymeleaf snippets.Java Server Pages (JSP) (Patrik Thorsson: MIT)
(unmaintained) JSP language support for Visual Studio Code, ported from TextMate's JSP bundle.Community Server Connectors (Red Hat: EPL) / VS Code Document
This extension can start, stop, publish, and control servers such as Apache Felix, Karaf, and Tomcat..GlassIt-VSC (hikarin522: MIT)
VS Code Extension to set window to transparent on Windows and Linux platforms.GistPad (Jonathan Carter: MIT)
Manage your code snippets and developer notes using GitHub Gists and repositories.GitHub Copilot (GitHub: Subscription) / VS Code Document
Your AI pair programmer.GitHub Copilot Chat (GitHub: Subscription)
AI chat features powered by Copilot.
code --install-extension rangav.vscode-thunder-client
code --install-extension usernamehw.errorlens
code --install-extension SonarSource.sonarlint-vscode
code --install-extension shengchen.vscode-checkstyle
code --install-extension ryanluker.vscode-coverage-gutters
code --install-extension juhahinkula.thymeleaf
code --install-extension pthorsson.vscode-jsp
code --install-extension redhat.vscode-community-server-connector
code --install-extension s-nlf-fh.glassit
code --install-extension vsls-contrib.gistfs
code --install-extension GitHub.copilot
code --install-extension GitHub.copilot-chat


