Java language extension for coc.nvim
Published Package Summary
coc-java
Fork of vscode-java to works with coc.nvim.
Provides Java ™ language support via Eclipse ™ JDT Language Server, which utilizes Eclipse ™ JDT, M2Eclipse and Buildship.
Quick Start
- Install this extension by run command:
:CocInstall coc-java
-
On the following platforms, the extension should activate without any setup :
win32-x64,darwin-x64,darwin-arm64,linux-x64,linux-arm64.
If on another platform, or using the "universal" version, you can set a Java Development Kit. It must be Java 17 or above. -
Optionally, download and install a Java Development Kit for your project (Java 1.5 or above is supported). See Project JDKs for more details
-
Extension is activated when you first access a Java file
- Recognizes projects with Maven or Gradle build files in the directory hierarchy.
Note: this extension comes with bunlded jdt.ls from 1.14.0, the same as vscode-java.
Project JDKs
If you need to compile your projects against a different JDK version, it's recommended you configure the java.configuration.runtimes property in your user settings, eg:
"java.configuration.runtimes": [
{
"name": "JavaSE-1.8",
"path": "/path/to/jdk-8",
},
{
"name": "JavaSE-11",
"path": "/path/to/jdk-11",
},
{
"name": "JavaSE-23",
"path": "/path/to/jdk-23",
"default": true
},
]
The default runtime will be used when you open standalone Java files.
Features
- Supports code from Java 1.5 to Java 23
- Maven pom.xml project support
- Gradle project support (with experimental Android project import support)
- Standalone Java files support
- As-you-type reporting of parsing and compilation errors
- Code completion
- Code/Source actions / Refactoring
- Javadoc hovers
- Organize imports
- triggered manually (by
:call CocAction('organizeImport')) or on save when pasting code into a java file withCtrl+Shift+v(Cmd+Shift+von Mac)
- triggered manually (by
- Type search
- Code outline
- Code folding
- Code navigation
- Code lens (references/implementations)
- Highlights
- Code formatting (on-type/selection/file)
- Code snippets
- Annotation processing support (automatic for Maven projects)
- Semantic selection
- Diagnostic tags
- Call Hierarchy
- Type Hierarchy (
:CocCommand java.action.showTypeHierarchy) - Share indexes (enabled by configuration
java.sharedIndexes.enabled)
See the changelog for the latest release.
Semantic Highlighting
To enable semantic highlighting support, use configuration:
"semanticTokens.enable": true,
For java filetype only, use:
"[java]": {
"semanticTokens.enable": true,
}
Checkout :h coc-configuration-scope.
Buffer not work
The jdt.ls requires buffer saved to disk to work, save the buffer by :w
command and reload it by :e command in your vim. Or create the file on disk
before buffer create.
Compiler warnings
To customize compiler warnings, create the file root_project/.settings/org.eclipse.jdt.core.prefs with values presented at https://help.eclipse.org/neon/topic/org.eclipse.jdt.doc.isv/reference/api/org/eclipse/jdt/core/JavaCore.html
"Classpath is incomplete" warning
See https://github.com/redhat-developer/vscode-java/wiki/%22Classpath-is-incomplete%22-warning
Troubleshooting
- Text
OKwould be in your statusline when jdt.ls is ready and you have statusline integration with coc.nvim. (could be configured byjava.jdt.ls.statusIcons) - Run
:CocOpenLogto get unexpected errors thrown by coc.nvim extensions. - Enable verbose trace for jdt.ls by add
"java.trace.server": "verbose"in your settings file, then check output by:CocCommand java.open.output - Run
:CocCommand java.open.serverLogto open log of jdt.ls. - Run
:CocCommand java.open.clientLogto open extension Log File. - Try
:CocCommand java.clean.workspaceto clean workspace cache.
Feedback
- Have a question? Start a discussion on GitHub Discussions,
- File a bug in GitHub Issues,
- Chat with us on Gitter,
License
EPL 1.0, See LICENSE for more information.
- Java language extension for coc.nvim
- onLanguage:java
- workspaceContains:pom.xml
- workspaceContains:*/pom.xml
- workspaceContains:build.gradle
- workspaceContains:*/build.gradle
- workspaceContains:settings.gradle
- workspaceContains:*/settings.gradle
- workspaceContains:build.gradle.kts
- workspaceContains:*/build.gradle.kts
- workspaceContains:settings.gradle.kts
- workspaceContains:*/settings.gradle.kts
- workspaceContains:.classpath
- workspaceContains:*/.classpath
Want to build, test, or contribute to coc.nvim extensions? Explore our official SDK and testing toolkits.
Open Developer GuideVersion History
Published with coc-java@1.56.0 as history.md.
Change Log
1.56.0 (2026-08-22)
Major features
- Synchronize Java language support with vscode-java 1.56.0, including Java 24-26 runtime definitions, newer JDT LS quick fixes and cleanups, and JSpecify null analysis defaults.
- Add an extended Java outline that includes inherited members and supports direct navigation.
- Support snippet-based workspace edits and whole-expression Java postfix completions.
- Improve JDT LS startup and project discovery across Maven and Gradle multi-module workspaces, ARM hosts, Termux, Windows, and older coc.nvim versions, with a stdio transport fallback.
New settings
java.transport: Select pipe or stdio transport for JDT LS.java.completion.lazyResolveTextEdit.enabled: Lazily resolve completion text edits.java.codeGeneration.generateCommentsInMarkdown: Generate Markdown-style Javadoc comments.java.templates.newFile.enabled: Control automatic type and package generation for new Java files.java.templates.methodBody: Customize generated unimplemented method bodies.java.templates.preferPackagePrivateVisibility: Prefer package-private visibility for new top-level types.java.templates.methodBodySuper: Customize generated overriding method bodies that callsuper.java.templates.catchBody: Customize generated catch block bodies.java.hover.javadoc.enabled: Control Javadoc display in hovers.java.referencesCodeLens.includeFields: Include fields in references CodeLens.java.symbols.includeGeneratedCode: Include generated code in document symbols.java.inlayHints.parameterNames.suppressWhenSameNameNumbered: Suppress redundant numbered parameter-name hints.java.inlayHints.variableTypes.enabled: Show inferred variable type hints.java.inlayHints.parameterTypes.enabled: Show inferred lambda parameter type hints.java.inlayHints.formatParameters.enabled: Show format-specifier parameter hints.java.search.scope: Selectall,main, orprojectOnlyfor references, call hierarchy, and workspace symbol searches.java.jdt.ls.aspectjSupport.enabled: Enable AspectJ support for Gradle projects.java.jdt.ls.kotlinSupport.enabled: Enable experimental Kotlin support for Gradle projects.java.jdt.ls.scalaSupport.enabled: Enable experimental Scala support for Gradle projects.java.jdt.ls.groovySupport.enabled: Enable experimental Groovy support for Gradle projects.java.jdt.ls.appcds.enabled: Control experimental AppCDS startup optimization.
New commands
java.runtimes.add: Add Java Runtime.java.change.searchScope: Change Java Search Scope.java.action.copyFullyQualifiedName: Copy Fully Qualified Name.java.action.showExtendedOutline: Open Extended Outline.
1.15.0 (2023-09-20)
- performance - Skip generated methods when calculating document symbols.
- performance - Make the debounce adaptive for the publish diagnostic job.
- performance - Only perform context sensitive import rewrite when resolving completion items.
- performance - Extension activation should not depend on language server being started.
- enhancement - Support "extract interface" refactoring.
- enhancement - Add "Convert String concatenation to Text Block" quick assist.
- enhancement - Add clean up for using
try-with-resource. - enhancement - Enable formatting support in syntax server.
- enhancement - Add option to configure behaviour when mojo execution metadata not available.
- enhancement - Add option to permit usage of test resources of a Maven project as dependencies within the compile scope of other projects.
- bug fix - Change default generated method stub to throw exception.
- bug fix - Prevent the paste handler for missing imports from generating overlapping text edits.
- bug fix - Reference search doesn't work for fields in JDK classes.
- bug fix - Paste event handling blocks pasting while project loading.
- bug fix - Avoid generating boilerplate code repeatedly in new Java file.
- bug fix - Completion results should include filtered (excluded) types if they are also present in the import declarations.
- bug fix - Fix type hierarchy regression since VS Code 1.75.1.
- bug fix - Re-publish diagnostics for null analysis configuration change when auto-build is disabled.
- bug fix - Dependency Analytics extension popup shoud respect user choice.
- bug fix - Only do full build for a configuration change when auto-build is enabled.
- bug fix - The command to upgrade gradle should check for cancellation prior to updating metadata files.
- bug fix - Fix incorrect ordering of completion items that use a decorator.
- bug fix - Reduce the amount of logging from
org.apache.httpbundles. - documentation - Clarify the
READMEquick start instructions.
1.14.1
- Fix background task not finish during completion by avoid selection range request.
- Fix an exception caused by undefined kind of WorkspaceSymbol on resolve.
1.14.0 (2023-01-29)
- Synchronize with [email protected].
Standardlaunch mode is used by default, because bugs withHybridmode.
Contributed Commands
All contributes.commands entries from the published package manifest for coc-java@1.56.0.
| Command (:CocCommand) | Description |
|---|---|
| java.server.mode.switch | Switch to Standard Mode |
| java.projectConfiguration.update | Reload Projects |
| java.project.import.command | Import Java Projects into Workspace |
| java.open.serverLog | Open Java Language Server Log File |
| java.open.serverStdoutLog | Open Java Language Server Output Log File |
| java.open.serverStderrLog | Open Java Language Server Error Log File |
| java.open.clientLog | Open Java Extension Log File |
| java.open.logs | Open All Log Files |
| java.workspace.compile | Force Java Compilation |
| java.project.build | Rebuild Projects |
| java.open.formatter.settings | Open Java Formatter Settings |
| java.clean.workspace | Clean Java Language Server Workspace |
| java.project.updateSourceAttachment.command | Attach Source |
| java.project.addToSourcePath.command | Add Folder to Java Source Path |
| java.project.removeFromSourcePath.command | Remove Folder from Java Source Path |
| java.project.listSourcePaths.command | List All Java Source Paths |
| java.show.server.task.status | Show Build Job Status |
| java.action.navigateToSuperImplementation | Go to Super Implementation |
| java.action.showTypeHierarchy | Show Type Hierarchy |
| java.action.doCleanup | Manually apply cleanup actions |
| java.action.showClassHierarchy | Show Class Hierarchy |
| java.action.showSupertypeHierarchy | Show Supertype Hierarchy |
| java.action.showSubtypeHierarchy | Show Subtype Hierarchy |
| java.action.changeBaseType | Base on this Type |
| java.project.createModuleInfo.command | Create module-info.java |
| _java.learnMoreAboutCleanUps | Learn more about Java Clean Ups |
| java.clean.sharedIndexes | Clean Shared Indexes |
| java.runtimes.add | Add Java Runtime |
| java.change.searchScope | Change Java Search Scope |
| java.action.copyFullyQualifiedName | Copy Fully Qualified Name |
| java.action.showExtendedOutline | Open Extended Outline |
Configuration Schema
All contributes.configuration entries from the published package manifest, including each raw property schema for coc-settings.json.
Raw JSON Schema
{
"type": [
"string",
"null"
],
"scope": "machine-overridable",
"default": null,
"description": "Specifies the folder path to the JDK (17 or more recent) used to launch the Java Language Server.\nOn Windows, backslashes must be escaped, i.e.\n\"java.home\":\"C:\\\\Program Files\\\\Java\\\\jdk-17.0_3\"",
"deprecationMessage": "This setting is deprecated, please use 'java.jdt.ls.java.home' instead."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "When false, coc-java is disabled."
}Raw JSON Schema
{
"enum": [
"pipe",
"stdio"
],
"type": "string",
"scope": "machine-overridable",
"default": "pipe",
"description": "Transport used to communicate with the Java Language Server. Use 'stdio' when the default pipe transport cannot establish a connection."
}Raw JSON Schema
{
"enum": [
"all",
"main",
"projectOnly"
],
"type": "string",
"scope": "window",
"default": "all",
"enumDescriptions": [
"Search on all classpath entries including reference libraries and projects.",
"All classpath entries excluding test classpath entries.",
"Only search sources, tests, and referenced projects, excluding the JDK and referenced libraries from the search."
],
"markdownDescription": "Specifies the scope which must be used for search operation like \n - Find Reference\n - Call Hierarchy\n - Workspace Symbols"
}Raw JSON Schema
{
"type": "string",
"scope": "window",
"default": null,
"markdownDescription": "Specifies the url or file path to the workspace Java settings. See [Setting Global Preferences](https://github.com/redhat-developer/vscode-java/wiki/Settings-Global-Preferences)"
}Raw JSON Schema
{
"enum": [
"off",
"messages",
"verbose"
],
"type": "string",
"scope": "window",
"default": "off",
"description": "Traces the communication between VS Code and the Java language server."
}Raw JSON Schema
{
"type": [
"string",
"null"
],
"scope": "machine-overridable",
"default": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx2G -Xms100m -Xlog:disable",
"description": "Specifies extra VM arguments used to launch the Java Language Server. Eg. use `-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx2G -Xms100m -Xlog:disable` to optimize memory usage with the parallel garbage collector"
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"description": "Enable/disable default Java formatter"
}Raw JSON Schema
{
"type": "array",
"scope": "window",
"default": [],
"description": "Additional bundles to load when starting jdt.ls, e.g. those from vscode-java-debug, vscode-java-test, etc."
}Raw JSON Schema
{
"type": "array",
"items": {
"enum": [
"qualifyMembers",
"qualifyStaticMembers",
"addOverride",
"addDeprecated",
"stringConcatToTextBlock",
"invertEquals",
"addFinalModifier",
"instanceofPatternMatch",
"lambdaExpressionFromAnonymousClass",
"lambdaExpression",
"switchExpression",
"tryWithResource",
"renameFileToType",
"organizeImports",
"renameUnusedLocalVariables",
"useSwitchForInstanceofPattern",
"redundantComparisonStatement",
"redundantFallingThroughBlockEnd",
"redundantIfCondition",
"redundantModifiers",
"redundantSuperCall"
],
"type": "string"
},
"order": 10,
"scope": "window",
"default": [
"renameFileToType"
],
"markdownDescription": "The list of clean ups to be run on the current document when it's saved or when the cleanup command is issued. Clean ups can automatically fix code style or programming mistakes. Click [HERE](command:_java.learnMoreAboutCleanUps) to learn more about what each clean up does."
}Raw JSON Schema
{
"enum": [
"line",
"problem"
],
"type": "string",
"scope": "window",
"default": "line",
"description": "Show quickfixes at the problem or line level."
}Raw JSON Schema
{
"type": [
"string",
"null"
],
"scope": "application",
"default": null,
"description": "Specifies the directory that contains jdt.ls"
}Raw JSON Schema
{
"type": [
"string",
"null"
],
"scope": "machine-overridable",
"default": null,
"description": "Specifies the folder path to the JDK (17 or more recent) used to launch the Java Language Server. This setting will replace the Java extension's embedded JRE to start the Java Language Server. \n\nOn Windows, backslashes must be escaped, i.e.\n\"java.jdt.ls.java.home\":\"C:\\\\Program Files\\\\Java\\\\jdk-17.0_3\""
}Raw JSON Schema
{
"enum": [
"ignore",
"warning",
"setDefault"
],
"scope": "window",
"default": "ignore",
"enumDescriptions": [
"Ignore project encoding settings",
"Show warning if a project has no explicit encoding set",
"Set the default workspace encoding settings"
],
"markdownDescription": "Project encoding settings"
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"description": "Enable/disable the 'auto build'"
}Raw JSON Schema
{
"enum": [
"ecj",
"dom"
],
"type": "string",
"order": 1000,
"scope": "window",
"default": "ecj",
"description": "[Experimental] Select code completion engine",
"markdownEnumDescriptions": [
"Use ECJ-based code completion engine (default)",
"Use (highly experimental) JDT DOM-based code completion engine (requires `java.jdt.ls.javac.enabled` to be `on`)"
]
}Raw JSON Schema
{
"type": "array",
"scope": "window",
"default": [
"**/node_modules/**",
"**/.metadata/**",
"**/archetype-resources/**",
"**/META-INF/maven/**"
],
"description": "Configure glob patterns for excluding folders. Use `!` to negate patterns to allow subfolders imports. You have to include a parent directory. The order is important."
}Raw JSON Schema
{
"enum": [
"Standard",
"LightWeight",
"Hybrid"
],
"type": "string",
"scope": "window",
"default": "Standard",
"description": "The launch mode for the Java extension",
"enumDescriptions": [
"Provides full features such as intellisense, refactoring, building, Maven/Gradle support etc.",
"Starts a syntax server with lower start-up cost. Only provides syntax features such as outline, navigation, javadoc, syntax errors.",
"Provides full features with better responsiveness. It starts a standard language server and a secondary syntax server. The syntax server provides syntax features until the standard server is ready."
]
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"description": "Enable/disable code completion support"
}Raw JSON Schema
{
"type": "string",
"scope": "window",
"default": null,
"description": "Use Gradle from the specified local installation directory or GRADLE_HOME if the Gradle wrapper is missing or disabled and no 'java.import.gradle.version' is specified."
}Raw JSON Schema
{
"type": [
"object",
"null"
],
"default": null,
"description": "Specifies the status icon for the Java Language Server. The status icon is displayed in the status bar when the Java Language Server is running. default to {\"ready\": \"OK\", \"warning\": \"Warning\", \"Error\", \"Error\"}"
}Raw JSON Schema
{
"type": "boolean",
"scope": "application",
"default": true,
"description": "Enable/disable the server-mode switch information, when Java projects import is skipped on startup."
}Raw JSON Schema
{
"type": [
"string",
"null"
],
"scope": "window",
"default": "",
"markdownDescription": "A relative path to the workspace where stores the compiled output. `Only` effective in the `WORKSPACE` scope. The setting will `NOT` affect Maven or Gradle project."
}Raw JSON Schema
{
"type": "string",
"scope": "window",
"default": null,
"markdownDescription": "Specifies the url or file path to the [Eclipse formatter xml settings](https://github.com/redhat-developer/vscode-java/wiki/Formatter-settings)."
}Raw JSON Schema
{
"type": "integer",
"scope": "window",
"default": 1,
"minimum": 1,
"description": "Max simultaneous project builds"
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"scope": "window",
"default": [],
"markdownDescription": "Relative paths to the workspace where stores the source files. `Only` effective in the `WORKSPACE` scope. The setting will `NOT` affect Maven or Gradle project."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Enable/disable cleanup actions on save."
}Raw JSON Schema
{
"type": "array",
"scope": "window",
"default": [
"// ${todo} Auto-generated catch block",
"${exception_var}.printStackTrace();"
],
"markdownDescription": "Specifies the catch block body snippet (e.g. generated by \"Surround with try/catch\"). Supports configuring multi-line content with an array of strings, and using ${variable} to reference the [predefined variables](command:_java.templateVariables)."
}Raw JSON Schema
{
"enum": [
"auto",
"firstLetter",
"off"
],
"type": "string",
"scope": "window",
"default": "auto",
"enumDescriptions": [
"Only match case for the first letter when using Visual Studio Code - Insiders.",
"Match case for the first letter when doing completion.",
"Do not match case when doing completion."
],
"markdownDescription": "Specify whether to match case for code completion."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"description": "Enable/disable smart folding range support. If disabled, it will use the default indentation-based folding range provided by VS Code."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"description": "Enable/disable the Maven importer."
}Raw JSON Schema
{
"enum": [
"on",
"off"
],
"type": "string",
"order": 95,
"scope": "window",
"default": "off",
"markdownDescription": "[Experimental] Specify whether to enable Javac-based compilation in the language server. Requires running this extension with Java 23"
}Raw JSON Schema
{
"type": "array",
"scope": "window",
"default": [],
"markdownDescription": "Specifies the file header comment for new Java file. Supports configuring multi-line comments with an array of strings, and using ${variable} to reference the [predefined variables](command:_java.templateVariables)."
}Raw JSON Schema
{
"type": "array",
"scope": "window",
"default": [
"// ${todo} Auto-generated method stub",
"throw new UnsupportedOperationException(\"Unimplemented method '${enclosing_method}'\");"
],
"markdownDescription": "Specifies the method body snippet for unimplemented methods (e.g. generated by \"Add unimplemented methods\"). Supports configuring multi-line content with an array of strings, and using ${variable} to reference the [predefined variables](command:_java.templateVariables)."
}Raw JSON Schema
{
"type": "array",
"items": {
"enum": [
"qualifyMembers",
"qualifyStaticMembers",
"addOverride",
"addDeprecated",
"stringConcatToTextBlock",
"invertEquals",
"addFinalModifier",
"instanceofPatternMatch",
"lambdaExpressionFromAnonymousClass",
"lambdaExpression",
"switchExpression",
"tryWithResource"
],
"type": "string"
},
"scope": "window",
"default": [],
"deprecationMessage": "Deprecated, please use 'java.cleanup.actions' instead."
}Raw JSON Schema
{
"type": "integer",
"scope": "window",
"default": 0,
"markdownDescription": "Maximum number of completion results (not including snippets).\n`0` (the default value) disables the limit, all results are returned. In case of performance problems, consider setting a sensible limit."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"description": "Enable/disable automatic block formatting when typing `;`, `<enter>` or `}`"
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"description": "Enable/disable displaying Javadoc on hover."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"description": "Enable/disable the Gradle importer."
}Raw JSON Schema
{
"type": "string",
"scope": "window",
"default": null,
"description": "Use Gradle from the specific version if the Gradle wrapper is missing or disabled."
}Raw JSON Schema
{
"enum": [
"auto",
"on",
"off"
],
"type": "string",
"scope": "machine-overridable",
"default": "auto",
"markdownDescription": "[Experimental] Enable Java AppCDS (Application Class Data Sharing) to improve language-server activation. `auto` enables it for timestamped pre-release builds; use `on` to opt in for stable builds."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": false,
"description": "Enable/disable download of Maven source artifacts as part of importing Maven projects."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": false,
"description": "Force update of Snapshots/Releases."
}Raw JSON Schema
{
"enum": [
"auto",
"on",
"off"
],
"type": "string",
"scope": "window",
"default": "auto",
"markdownDescription": "[Experimental] Specify whether to share indexes between different workspaces. When set to `auto`, shared indexes will be enabled in Visual Studio Code - Insiders."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"description": "Enable/disable the signature help."
}Raw JSON Schema
{
"type": "array",
"scope": "window",
"default": [],
"markdownDescription": "Specifies the type comment for new Java type. Supports configuring multi-line comments with an array of strings, and using ${variable} to reference the [predefined variables](command:_java.templateVariables)."
}Raw JSON Schema
{
"type": "array",
"scope": "window",
"default": [
"#",
"java",
"javax",
"org",
"com",
""
],
"description": "Defines the sorting order of import statements. A package or type name prefix (e.g. 'org.eclipse') is a valid entry. An import is always added to the most specific group. As a result, the empty string (e.g. '') can be used to group all other imports. Static imports are prefixed with a '#'"
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "object",
"default": {},
"required": [
"path",
"name"
],
"properties": {
"name": {
"enum": [
"JavaSE-1.8",
"JavaSE-9",
"JavaSE-10",
"JavaSE-11",
"JavaSE-12",
"JavaSE-13",
"JavaSE-14",
"JavaSE-15",
"JavaSE-16",
"JavaSE-17",
"JavaSE-18",
"JavaSE-19",
"JavaSE-20",
"JavaSE-21",
"JavaSE-22",
"JavaSE-23",
"JavaSE-24",
"JavaSE-25",
"JavaSE-26"
],
"type": "string",
"description": "Java Execution Environment name. Must be unique."
},
"path": {
"type": "string",
"pattern": ".*(?<!\\/bin|\\/bin\\/|\\\\bin|\\\\bin\\\\)$",
"description": "JDK home path. Should be the JDK installation directory, not the Java bin path.\n On Windows, backslashes must be escaped, i.e.\n\"path\":\"C:\\\\Program Files\\\\Java\\\\jdk1.8.0_161\"."
},
"default": {
"type": "boolean",
"description": "Is default runtime? Only one runtime can be default."
},
"javadoc": {
"type": "string",
"description": "JDK javadoc path."
},
"sources": {
"type": "string",
"description": "JDK sources path."
}
},
"additionalProperties": false
},
"scope": "machine-overridable",
"default": [],
"description": "Map Java Execution Environments to local JDKs."
}Raw JSON Schema
{
"enum": [
"all",
"none",
"types",
"methods"
],
"type": "string",
"order": 20,
"scope": "window",
"default": "none",
"description": "Enable/disable the implementations code lens for the provided categories.",
"enumDescriptions": [
"Disable the implementations code lens",
"Enable the implementations code lens only for types",
"Enable the implementations code lens only for methods",
"Enable the implementations code lens for types and methods"
]
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"description": "Enable/disable Smart Selection support for Java. Disabling this option will not affect the VS Code built-in word-based and bracket-based smart selection."
}Raw JSON Schema
{
"type": "string",
"scope": "window",
"default": "",
"markdownDescription": "Specifies a common index location for all workspaces. See default values as follows:\n \nWindows: First use `\"$APPDATA\\\\.jdt\\\\index\"`, or `\"~\\\\.jdt\\\\index\"` if it does not exist\n \nmacOS: `\"~/Library/Caches/.jdt/index\"`\n \nLinux: First use `\"$XDG_CACHE_HOME/.jdt/index\"`, or `\"~/.cache/.jdt/index\"` if it does not exist"
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": false,
"description": "Enable/disable lazy loading the content in type hierarchy. Lazy loading could save a lot of loading time but every type should be expanded manually to load its content."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": false,
"description": "Enable/disable download of Maven source artifacts for Eclipse projects."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"description": "Includes the comments during code formatting."
}Raw JSON Schema
{
"type": "string",
"scope": "window",
"default": null,
"description": "Optional formatter profile name from the Eclipse formatter settings."
}Raw JSON Schema
{
"type": "string",
"scope": "machine",
"default": null,
"description": "Arguments to pass to Gradle."
}Raw JSON Schema
{
"type": "string",
"scope": "machine-overridable",
"default": null,
"description": "The location to the JVM used to run the Gradle daemon."
}Raw JSON Schema
{
"type": "string",
"scope": "machine-overridable",
"default": null,
"description": "Setting for GRADLE_USER_HOME."
}Raw JSON Schema
{
"enum": [
"manual",
"automatic"
],
"type": "string",
"scope": "window",
"default": "automatic",
"enumDescriptions": [
"Manually select the build configuration files.",
"Let extension automatically scan and select the build configuration files."
],
"markdownDescription": "[Experimental] Specifies how to select build configuration files to import. \nNote: Currently, `Gradle` projects cannot be partially imported."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"description": "[Experimental] Enable/disable progress reports from background processes on the server."
}Raw JSON Schema
{
"type": "array",
"scope": "window",
"default": [
"node_modules",
"\\.git"
],
"description": "Excludes files and folders from being refreshed by the Java Language Server, which can improve the overall performance. For example, [\"node_modules\",\"\\.git\"] will exclude all files and folders named 'node_modules' or '.git'. Pattern expressions must be compatible with `java.util.regex.Pattern`. Defaults to [\"node_modules\",\"\\.git\"]."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": false,
"description": "Use blocks in 'if' statements when generating the methods."
}Raw JSON Schema
{
"type": "array",
"scope": "window",
"default": [
"java.awt.*",
"com.sun.*",
"sun.*",
"jdk.*",
"org.graalvm.*",
"io.micrometer.shaded.*"
],
"description": "Defines the type filters. All types whose fully qualified name matches the selected filter strings will be ignored in content assist or quick fix proposals and when organizing imports. For example 'java.awt.*' will hide all types from the awt packages."
}Raw JSON Schema
{
"type": "boolean",
"scope": "machine-overridable",
"default": true,
"description": "Detect the configuration runtimes from all possible locations on the machine"
}Raw JSON Schema
{
"enum": [
"disabled",
"interactive",
"automatic"
],
"type": "string",
"scope": "window",
"default": "interactive",
"markdownDescription": "Specify how to enable the annotation-based null analysis."
}Raw JSON Schema
{
"type": "string",
"scope": "window",
"default": null,
"description": "Preferred content provider (a 3rd party decompiler id, usually)"
}Raw JSON Schema
{
"type": "array",
"scope": "window",
"default": [
"// ${todo} Auto-generated method stub",
"${body_statement}"
],
"markdownDescription": "Specifies the method body snippet for overridden methods that call `super` (e.g. generated by \"Override/Implement Methods\"). Supports configuring multi-line content with an array of strings, and using ${variable} to reference the [predefined variables](command:_java.templateVariables)."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"markdownDescription": "Enable/disable automatic generation of class body and package declaration when creating a new Java file. Set to `false` to create empty Java files. Defaults to `true`."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"markdownDescription": "Enable/disable postfix completion support. `#editor.snippetSuggestions#` can be used to customize how postfix snippets are sorted."
}Raw JSON Schema
{
"type": "string",
"scope": "machine",
"default": null,
"description": "JVM arguments to pass to Gradle."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": false,
"description": "Enable/disable the references code lens."
}Raw JSON Schema
{
"enum": [
"ask",
"auto",
"manual"
],
"type": "string",
"scope": "window",
"default": "ask",
"enumDescriptions": [
"Ask to reload the sources of the open class files",
"Automatically reload the sources of the open class files",
"Manually reload the sources of the open class files"
],
"markdownDescription": "Specifies whether to reload the sources of the open class files when their source jar files are changed."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"markdownDescription": "[Experimental] Specify whether to enable `scala` plugin in Gradle projects. Defaults to `true`."
}Raw JSON Schema
{
"type": [
"array",
"object"
],
"scope": "window",
"default": [
"lib/**/*.jar"
],
"required": [
"include"
],
"properties": {
"exclude": {
"type": "array"
},
"include": {
"type": "array"
},
"sources": {
"type": "object"
}
},
"description": "Configure glob patterns for referencing local libraries to a Java project.",
"additionalProperties": false
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"description": "Include getter, setter and builder/constructor when finding references."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": false,
"description": "Enable/disable auto organize imports on save action",
"deprecationMessage": "This setting is deprecated, please configure 'editor.codeActionsOnSave' instead."
}Raw JSON Schema
{
"type": "array",
"scope": "window",
"default": [
"javax.annotation.Nonnull",
"org.eclipse.jdt.annotation.NonNull",
"org.springframework.lang.NonNull",
"org.jspecify.annotations.NonNull"
],
"markdownDescription": "Specify the Nonnull annotation types to be used for null analysis. If more than one annotation is specified, then the topmost annotation will be used first if it exists in project dependencies. This setting will be ignored if `java.compile.nullAnalysis.mode` is set to `disabled`"
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": false,
"description": "Enable/disable the Maven offline mode."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"markdownDescription": "[Experimental] Specify whether to enable `groovy` plugin in Gradle projects. Defaults to `true`."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"markdownDescription": "[Experimental] Specify whether to enable `org.jetbrains.kotlin.jvm` plugin in Gradle projects. Defaults to `true`."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"description": "Whether to load lombok processors from project classpath"
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": false,
"markdownDescription": "Include generated code (e.g. Lombok getters, setters, constructors) in document outline/symbols."
}Raw JSON Schema
{
"type": "array",
"scope": "window",
"default": [
"javax.annotation.Nullable",
"org.eclipse.jdt.annotation.Nullable",
"org.springframework.lang.Nullable",
"org.jspecify.annotations.Nullable"
],
"markdownDescription": "Specify the Nullable annotation types to be used for null analysis. If more than one annotation is specified, then the topmost annotation will be used first if it exists in project dependencies. This setting will be ignored if `java.compile.nullAnalysis.mode` is set to `disabled`"
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": false,
"description": "Enable/disable the Gradle offline mode."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"description": "Use Gradle from the 'gradle-wrapper.properties' file."
}Raw JSON Schema
{
"enum": [
"auto",
"on",
"off"
],
"type": "string",
"scope": "window",
"default": "auto",
"markdownDescription": "[Experimental] Specify whether to enable Android project importing. When set to `auto`, the Android support will be enabled in Visual Studio Code - Insiders.\n\n**Note:** Only works for Android Gradle Plugin `3.2.0` or higher."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": false,
"markdownDescription": "Specify whether to enable `io.freefair.aspectj` plugin in Gradle projects. Defaults to `false`."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"markdownDescription": "Specify whether to automatically add Protobuf output source directories to the classpath.\n\n**Note:** Only works for Gradle `com.google.protobuf` plugin `0.8.4` or higher."
}Raw JSON Schema
{
"type": "boolean",
"order": 40,
"scope": "window",
"default": false,
"description": "Include declarations when finding references."
}Raw JSON Schema
{
"anyOf": [
{
"enum": [
"notification",
"terminal",
"off"
],
"enumDescriptions": [
"Show the build status via progress notification on start",
"Show the build status via terminal on start",
"Do not show any build status on start"
]
},
"boolean"
],
"scope": "window",
"default": "notification",
"description": "Automatically show build status on startup."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": false,
"description": "Generate method comments when generating the methods."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"description": "When set to true, method arguments are guessed when a method is selected from as list of code assist proposals."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": false,
"description": "Enable/disable the implementations code lens."
}Raw JSON Schema
{
"enum": [
"afterCursor",
"beforeCursor",
"lastMember"
],
"type": "string",
"scope": "window",
"default": "afterCursor",
"description": "Specifies the insertion location of the code generated by source actions.",
"enumDescriptions": [
"Insert the generated code after the member where the cursor is located.",
"Insert the generated code before the member where the cursor is located.",
"Insert the generated code as the last member of the target type."
]
}Raw JSON Schema
{
"type": "string",
"default": "${object.className} [${member.name()}=${member.value}, ${otherMembers}]",
"description": "The template for generating the toString method."
}Raw JSON Schema
{
"type": "array",
"scope": "window",
"default": [
"org.junit.Assert.*",
"org.junit.Assume.*",
"org.junit.jupiter.api.Assertions.*",
"org.junit.jupiter.api.Assumptions.*",
"org.junit.jupiter.api.DynamicContainer.*",
"org.junit.jupiter.api.DynamicTest.*",
"org.mockito.Mockito.*",
"org.mockito.ArgumentMatchers.*",
"org.mockito.Answers.*"
],
"description": "Defines a list of static members or types with static members. Content assist will propose those static members even if the import is missing."
}Raw JSON Schema
{
"type": "string",
"scope": "window",
"default": null,
"description": "Path to Maven's user settings.xml"
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "object",
"default": {},
"required": [
"sha256"
],
"properties": {
"sha256": {
"type": "string",
"label": "SHA-256 checksum."
},
"allowed": {
"type": "boolean",
"label": "Is allowed?",
"default": true
}
},
"uniqueItems": true,
"additionalProperties": false
},
"scope": "application",
"default": [],
"description": "Defines allowed/disallowed SHA-256 checksums of Gradle Wrappers"
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": false,
"markdownDescription": "Enable/disable inlay hints for implicit variable types:\n```java\n\nvar foo /* :Path */ = Path.of(\"foo\");\n \n```"
}Raw JSON Schema
{
"enum": [
"disabled",
"interactive",
"automatic"
],
"type": "string",
"scope": "application",
"default": "automatic",
"description": "Specifies whether to import the Java projects, when opening the folder in Hybrid mode for the first time."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": false,
"description": "Enable/disable the references code lens for fields."
}Raw JSON Schema
{
"enum": [
"STRING_CONCATENATION",
"STRING_BUILDER",
"STRING_BUILDER_CHAINED",
"STRING_FORMAT"
],
"type": "string",
"default": "STRING_CONCATENATION",
"description": "The code style for generating the toString method.",
"enumDescriptions": [
"String concatenation",
"StringBuilder/StringBuffer",
"StringBuilder/StringBuffer - chained call",
"String.format/MessageFormat"
]
}Raw JSON Schema
{
"type": [
"null",
"integer"
],
"scope": "application",
"default": 90,
"minimum": 1,
"description": "The number of days (if enabled) to keep unused workspace cache data. Beyond this limit, cached workspace data may be removed."
}Raw JSON Schema
{
"enum": [
"none",
"literals",
"all"
],
"type": "string",
"scope": "window",
"default": "literals",
"enumDescriptions": [
"Disable parameter name hints",
"Enable parameter name hints only for literal arguments",
"Enable parameter name hints for literal and non-literal arguments"
],
"markdownDescription": "Enable/disable inlay hints for parameter names:\n```java\n\nInteger.valueOf(/* s: */ '123', /* radix: */ 10)\n \n```\n `#java.inlayHints.parameterNames.exclusions#` can be used to disable the inlay hints for methods."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": false,
"markdownDescription": "Enable/disable inlay hints for (lambda) parameter types:\n```java\n\nList.of(1, 2, 3, 4).filter(/*Integer */ n -> n % 2 == 0).toList();\n \n```"
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": false,
"description": "Enable/disable to show the description in signature help."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": false,
"markdownDescription": "Enable/disable the collapse of overloaded methods in completion items. Overrides `#java.completion.guessMethodArguments#`."
}Raw JSON Schema
{
"type": "string",
"scope": "window",
"default": null,
"description": "Path to Maven's global settings.xml"
}Raw JSON Schema
{
"enum": [
"ignore",
"info",
"warning",
"error"
],
"type": [
"string"
],
"scope": "window",
"default": "warning",
"description": "Specifies the severity of the message when the classpath is incomplete for a Java file"
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": false,
"markdownDescription": "Enable/disable inlay hints for format specifiers in format strings (e.g. `String.format()`, `String.formatted()`, `PrintStream.printf()`). Shows which argument corresponds to each format specifier."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"description": "Include the decompiled sources when finding references."
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"scope": "window",
"default": [],
"markdownDescription": "The patterns for the methods that will be disabled to show the inlay hints. Supported pattern examples:\n - `java.lang.Math.*` - All the methods from java.lang.Math.\n - `*.Arrays.asList` - Methods named as 'asList' in the types named as 'Arrays'.\n - `*.println(*)` - Methods named as 'println'.\n - `(from, to)` - Methods with two parameters named as 'from' and 'to'.\n - `(arg*)` - Methods with one parameter whose name starts with 'arg'."
}Raw JSON Schema
{
"type": "integer",
"scope": "window",
"default": 0,
"description": "Limit number of items in arrays/collections/maps to list, if 0 then list all."
}Raw JSON Schema
{
"type": "array",
"scope": "window",
"default": [
"javax.annotation.ParametersAreNonnullByDefault",
"org.eclipse.jdt.annotation.NonNullByDefault",
"org.springframework.lang.NonNullApi",
"org.jspecify.annotations.NullMarked"
],
"markdownDescription": "Specify the NonNullByDefault annotation types to be used for null analysis. If more than one annotation is specified, then the topmost annotation will be used first if it exists in project dependencies. This setting will be ignored if `java.compile.nullAnalysis.mode` is set to `disabled`"
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": false,
"description": "Enable/disable test classpath segregation. When enabled, this permits the usage of test resources within a Maven project as dependencies within the compile scope of other projects."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"markdownDescription": "Specify whether to replace all the occurrences of the subtype with the new extracted interface."
}Raw JSON Schema
{
"type": "integer",
"scope": "window",
"default": 99,
"minimum": 1,
"description": "Specifies the number of imports added before a star-import declaration is used."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": false,
"description": "Skip null values when generating the toString method."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"description": "[Experimental] Enable/disable lazily resolving text edits for code completion."
}Raw JSON Schema
{
"enum": [
"disabled",
"interactive",
"automatic"
],
"type": [
"string"
],
"scope": "window",
"default": "interactive",
"description": "Specifies how modifications on build files update the Java classpath/configuration"
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": false,
"markdownDescription": "Include method declarations from source files in symbol search."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": false,
"markdownDescription": "Specifies whether newly created top-level types (class/interface/record) should be package-private instead of public."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"description": "Generate Javadoc comments in Markdown style (requires source compliance >= 23)."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"description": "List contents of arrays instead of using native toString()."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"description": "Show the recommended Dependency Analytics extension."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": false,
"markdownDescription": "Specify whether the project metadata files(.project, .classpath, .factorypath, .settings/) will be generated at the project root. Click [HERE](command:_java.metadataFilesGeneration) to learn how to change the setting to make it take effect."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"description": "Enable/disable the annotation processing on Gradle projects and delegate Annotation Processing to JDT APT. Only works for Gradle 5.2 or higher."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"description": "Reordering of fields, enum constants, and initializers can result in semantic and runtime changes due to different initialization and persistence order. This setting prevents this from occurring."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": false,
"description": "Use 'instanceof' to compare types when generating the hashCode and equals methods."
}Raw JSON Schema
{
"type": "integer",
"scope": "window",
"default": 99,
"minimum": 1,
"description": "Specifies the number of static imports added before a star-import declaration is used."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": false,
"description": "Controls whether to exclude extension-generated project settings files (.project, .classpath, .factorypath, .settings/) from the file explorer.",
"deprecationMessage": "Please use 'java.import.generatesMetadataFilesAtProjectRoot' to control whether to generate the project metadata files at the project root. And use 'files.exclude' to control whether to hide the project metadata files from the file explorer."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": false,
"description": "Use Objects.hash and Objects.equals when generating the hashCode and equals methods. This setting only applies to Java 7 and higher."
}Raw JSON Schema
{
"enum": [
"ignore",
"warn",
"error",
"execute"
],
"type": "string",
"scope": "window",
"default": "ignore",
"description": "Specifies default mojo execution action when no associated metadata can be detected."
}Raw JSON Schema
{
"enum": [
"ignore",
"warning",
"error"
],
"type": "string",
"scope": "window",
"default": "warning",
"description": "Specifies severity if the plugin execution is not covered by Maven build lifecycle."
}Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"markdownDescription": "Suppress parameter name hints on arguments following the same-name numbered pattern."
}