{"id":41672676,"url":"https://github.com/zed-extensions/java","last_synced_at":"2026-04-25T01:07:23.960Z","repository":{"id":223155954,"uuid":"759434789","full_name":"zed-extensions/java","owner":"zed-extensions","description":"Extension for Zed to support Java","archived":false,"fork":false,"pushed_at":"2026-02-09T20:22:26.000Z","size":225,"stargazers_count":162,"open_issues_count":13,"forks_count":36,"subscribers_count":6,"default_branch":"main","last_synced_at":"2026-02-09T23:55:46.270Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zed-extensions.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-02-18T15:34:59.000Z","updated_at":"2026-02-09T20:22:30.000Z","dependencies_parsed_at":"2025-12-27T19:03:55.441Z","dependency_job_id":null,"html_url":"https://github.com/zed-extensions/java","commit_stats":null,"previous_names":["samuser107/zed-java-extension","louisnicolas-longheval-vinci/zed-java-extension","zed-extensions/java"],"tags_count":33,"template":false,"template_full_name":null,"purl":"pkg:github/zed-extensions/java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zed-extensions%2Fjava","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zed-extensions%2Fjava/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zed-extensions%2Fjava/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zed-extensions%2Fjava/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zed-extensions","download_url":"https://codeload.github.com/zed-extensions/java/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zed-extensions%2Fjava/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29686802,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T15:51:39.154Z","status":"ssl_error","status_checked_at":"2026-02-21T15:49:03.425Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-24T18:06:14.619Z","updated_at":"2026-04-25T01:07:23.951Z","avatar_url":"https://github.com/zed-extensions.png","language":"Rust","funding_links":[],"categories":["⭐ Top Extensions"],"sub_categories":[],"readme":"# Java Extension for Zed\n\nThis extension adds support for the Java language to [Zed](https://zed.dev). It is using the [Eclipse JDT Language Server](https://projects.eclipse.org/projects/eclipse.jdt.ls) (JDTLS for short) to provide completions, code-actions and diagnostics.\n\n## Quick Start\n\nInstall the extension via Zeds extension manager. It should work out of the box for most people. However, there are some things to know:\n\n- It is generally recommended to open projects with the Zed-project root at the Java project root folder (where you would commonly have your `pom.xml` or `build.gradle` file).\n\n- By default the extension will download and run the latest official version of JDTLS for you, but this requires Java version 21 to be available on your system via either the `$JAVA_HOME` environment variable or as a `java(.exe)` executable on your `$PATH`. If your project requires a lower Java version in the environment, you can specify a different JDK to use for running JDTLS via the `java_home` configuration option.\n\n- You can provide a **custom launch script for JDTLS**, by adding an executable named `jdtls` (or `jdtls.bat` on Windows) to your `$PATH` environment variable. If this is present, the extension will skip downloading and launching a managed instance and use the one from the environment.\n\n- To support [Lombok](https://projectlombok.org/), the lombok-jar must be downloaded and registered as a Java-Agent when launching JDTLS. By default the extension automatically takes care of that, but in case you don't want that you can set the `lombok_support` configuration-option to `false`.\n\n- The option to let the extension automatically download a version of OpenJDK can be enabled by setting `jdk_auto_download` to `true`. When enabled, the extension will only download a JDK if no valid java_home is provided or if the specified one does not meet the minimum version requirement. User-provided JDKs **always** take precedence.\n\nHere is a common `settings.json` including the above mentioned configurations:\n\n```jsonc\n\"lsp\": {\n \"jdtls\": {\n    \"settings\": {\n      \"java_home\": \"/path/to/your/JDK21+\",\n      \"lombok_support\": true,\n      \"jdk_auto_download\": false,\n\n      // Controls when to check for updates for JDTLS, Lombok, and Debugger\n      // - \"always\" (default): Always check for and download the latest version\n      // - \"once\": Check for updates only if no local installation exists\n      // - \"never\": Never check for updates, only use existing local installations (errors if missing)\n      //\n      // Note: Invalid values will default to \"always\"\n      // If custom paths (below) are provided, check_updates is IGNORED for that component\n      \"check_updates\": \"always\",\n      \n      // Use custom installations instead of managed downloads\n      // When these are set, the extension will not download or manage these components\n      \"jdtls_launcher\": \"/path/to/your/jdt-language-server/bin/jdtls\",\n      \"lombok_jar\": \"/path/to/your/lombok.jar\",\n      \"java_debug_jar\": \"/path/to/your/com.microsoft.java.debug.plugin.jar\"\n    }\n  }\n}\n```\n\n## Project Symbol Search\n\nThe extension supports project-wide symbol search with syntax-highlighted results. This feature is powered by JDTLS and can be accessed via Zed's symbol search.\n\nJDTLS uses **CamelCase fuzzy matching** for symbol queries. For example, searching for `EmpMe` would match `EmptyMedia`. The pattern works like `Emp*Me*`, matching the capital letters of CamelCase names.\n\n## Debugger\n\nDebug support is enabled via our [Fork of Java Debug](https://github.com/zed-industries/java-debug), which the extension will automatically download and start for you. Please refer to the [Zed Documentation](https://zed.dev/docs/debugger#getting-started) for general information about how debugging works in Zed.\n\nTo get started with Java, click the `edit debug.json` button in the Debug menu, and replace the contents of the file with the following:\n```jsonc\n[\n  {\n    \"adapter\": \"Java\",\n    \"request\": \"launch\",\n    \"label\": \"Launch Debugger\",\n    // if your project has multiple entry points, specify the one to use:\n    // \"mainClass\": \"com.myorganization.myproject.MyMainClass\",\n    //\n    // this effectively sets a breakpoint at your program entry:\n    \"stopOnEntry\": true,\n    // the working directory for the debug process\n    \"cwd\": \"$ZED_WORKTREE_ROOT\"\n  }\n]\n```\n\nYou should then be able to start a new Debug Session with the \"Launch Debugger\" scenario from the debug menu.\n\n### Single-File Debugging\n\nIf you're working a lot with single file debugging, you can use the following `debug.json` config instead:\n```jsonc\n[\n  {\n    \"label\": \"Debug $ZED_STEM\",\n    \"adapter\": \"Java\",\n    \"request\": \"launch\",\n    \"mainClass\": \"$ZED_STEM\",\n    \"build\": {\n      \"command\": \"javac -d . $ZED_FILE\",\n      \"shell\": {\n        \"with_arguments\": {\n          \"program\": \"/bin/sh\",\n          \"args\": [\"-c\"]\n        }\n      }\n    }\n  }\n]\n```\nThis will compile and launch the debugger using the currently selected file as the entry point. \nIdeally, we would implement a run/debug option directly in the runnables (similar to how the Rust extension does it), which would allow you to easily start a debugging session without explicitly updating the entry point.\nNote that integrating the debugger with runnables is currently limited to core languages in Zed, so this is the best workaround for now. \n\n## Launch Scripts (aka Tasks) in Windows\n\nThis extension provides tasks for running your application and tests from within Zed via little play buttons next to tests/entry points. However, due to current limitiations of Zed's extension interface, we can not provide scripts that will work across Maven and Gradle on both Windows and Unix-compatible systems, so out of the box the launch scripts only work on Mac and Linux.\n\nThere is a fairly straightforward fix that you can apply to make it work on Windows by supplying your own task scripts. Please see [this Issue](https://github.com/zed-extensions/java/issues/94) for information on how to do that and read the [Tasks section in Zeds documentation](https://zed.dev/docs/tasks) for more information.\n\n## Advanced Configuration/JDTLS initialization Options\nJDTLS provides many configuration options that can be passed via the `initialize` LSP-request. The extension will pass the JSON-object from `lsp.jdtls.initialization_options` in your settings on to JDTLS. Please refer to the [JDTLS Configuration Wiki Page](https://github.com/eclipse-jdtls/eclipse.jdt.ls/wiki/Running-the-JAVA-LS-server-from-the-command-line#initialize-request) for the available options and values. Below is an opinionated example configuration for JDTLS with most options enabled:\n\n```jsonc\n\"lsp\": {\n  \"jdtls\": {\n    \"initialization_options\": {\n      \"bundles\": [],\n      \"workspaceFolders\": [\n        \"file:///home/snjeza/Project\"\n      ],\n      \"settings\": {\n        \"java\": {\n          \"configuration\": {\n            \"updateBuildConfiguration\": \"automatic\",\n            \"runtimes\": []\n          },\n          \"saveActions\": {\n            \"organizeImports\": true\n          },\n          \"compile\": {\n            \"nullAnalysis\": {\n              \"mode\": \"automatic\"\n            }\n          },\n          \"references\": {\n            \"includeAccessors\": true,\n            \"includeDecompiledSources\": true\n          },\n          \"jdt\": {\n            \"ls\": {\n              \"protobufSupport\": {\n                \"enabled\": true\n              },\n              \"groovySupport\": {\n                \"enabled\": true\n              }\n            }\n          },\n          \"eclipse\": {\n            \"downloadSources\": true\n          },\n          \"maven\": {\n            \"downloadSources\": true,\n            \"updateSnapshots\": true\n          },\n          \"autobuild\": {\n            \"enabled\": true\n          },\n          \"maxConcurrentBuilds\": 1,\n          \"inlayHints\": {\n            \"parameterNames\": {\n              \"enabled\": \"all\"\n            }\n          },\n          \"signatureHelp\": {\n            \"enabled\": true,\n            \"description\": {\n              \"enabled\": true\n            }\n          },\n          \"format\": {\n            \"enabled\": true,\n            \"settings\": {\n              // The formatter config to use\n              \"url\": \"~/.config/jdtls/palantir_java_jdtls.xml\"\n            },\n            \"onType\": {\n              \"enabled\": true\n            }\n          },\n          \"contentProvider\": {\n            \"preferred\": null\n          },\n          \"import\": {\n            \"gradle\": {\n              \"enabled\": true,\n              \"wrapper\": {\n                \"enabled\": true\n              }\n            },\n            \"maven\": {\n              \"enabled\": true\n            },\n            \"exclusions\": [\n              \"**/node_modules/**\",\n              \"**/.metadata/**\",\n              \"**/archetype-resources/**\",\n              \"**/META-INF/maven/**\",\n              \"/**/test/**\"\n            ]\n          },\n          \"completion\": {\n            \"enabled\": true,\n            \"favoriteStaticMembers\": [\n              \"org.junit.Assert.*\",\n              \"org.junit.Assume.*\",\n              \"org.junit.jupiter.api.Assertions.*\",\n              \"org.junit.jupiter.api.Assumptions.*\",\n              \"org.junit.jupiter.api.DynamicContainer.*\",\n              \"org.junit.jupiter.api.DynamicTest.*\",\n              \"org.mockito.Mockito.*\",\n              \"org.mockito.ArgumentMatchers.*\"\n            ],\n            \"importOrder\": [\n              \"java\",\n              \"javax\",\n              \"com\",\n              \"org\"\n            ],\n            \"postfix\": {\n              \"enabled\": true\n            },\n            \"chain\": {\n              \"enabled\": true\n            },\n            \"guessMethodArguments\": \"insertParameterNames\",\n            \"overwrite\": true\n          },\n          \"errors\": {\n            \"incompleteClasspath\": {\n              \"severity\": \"warning\"\n            }\n          },\n          \"implementationCodeLens\": \"all\",\n          \"referencesCodeLens\": {\n            \"enabled\": true\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nIf you're working without a Gradle or Maven project, and the following error `The declared package \"Example\" does not match the expected package \"\"` pops up, consider adding these settings under\n\n```\nMyProject/\n ├── .zed/\n │   └── settings.json\n ```\n \n```jsonc\n\"lsp\": {\n  \"jdtls\": {\n    \"initialization_options\": {\n      \"project\": {\n        \"sourcePaths\": [\n          \".\",\n          \"src\"\n        ]\n      },\n    }\n  }\n}\n```\n\nIf changes are not picked up, clean JDTLS' cache (from a java file run the task `Clear JDTLS cache`) and restart the language server\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzed-extensions%2Fjava","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzed-extensions%2Fjava","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzed-extensions%2Fjava/lists"}