{"id":14811393,"url":"https://github.com/nvim-java/nvim-java","last_synced_at":"2026-02-04T06:15:19.154Z","repository":{"id":206966831,"uuid":"717003987","full_name":"nvim-java/nvim-java","owner":"nvim-java","description":"Painless Java in Neovim","archived":false,"fork":false,"pushed_at":"2025-12-11T05:58:26.000Z","size":500,"stargazers_count":1500,"open_issues_count":26,"forks_count":79,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-12-12T00:49:31.619Z","etag":null,"topics":["autocompletion","debugging","diagnostics","language-server-client","language-server-protocol","neovim","neovim-plugin","neovim-plugins","running","spring","spring-boot","testing"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nvim-java.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["s1n7ax"],"patreon":"s1n7ax","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2023-11-10T10:40:56.000Z","updated_at":"2025-12-11T13:45:31.000Z","dependencies_parsed_at":"2023-12-15T23:58:46.602Z","dependency_job_id":"c14d35b0-a752-4e0d-8204-a230cbdb1cc9","html_url":"https://github.com/nvim-java/nvim-java","commit_stats":null,"previous_names":["nvim-java/nvim-java"],"tags_count":45,"template":false,"template_full_name":null,"purl":"pkg:github/nvim-java/nvim-java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-java%2Fnvim-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-java%2Fnvim-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-java%2Fnvim-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-java%2Fnvim-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nvim-java","download_url":"https://codeload.github.com/nvim-java/nvim-java/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-java%2Fnvim-java/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29072971,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-04T03:31:03.593Z","status":"ssl_error","status_checked_at":"2026-02-04T03:29:50.742Z","response_time":62,"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":["autocompletion","debugging","diagnostics","language-server-client","language-server-protocol","neovim","neovim-plugin","neovim-plugins","running","spring","spring-boot","testing"],"created_at":"2024-09-18T08:00:48.050Z","updated_at":"2026-02-04T06:15:19.146Z","avatar_url":"https://github.com/nvim-java.png","language":"Lua","readme":"# :coffee: nvim-java\n\n![Spring](https://img.shields.io/badge/Spring-6DB33F?style=for-the-badge\u0026logo=spring\u0026logoColor=white)\n![Java](https://img.shields.io/badge/java-%23ED8B00.svg?style=for-the-badge\u0026logo=openjdk\u0026logoColor=white)\n![Gradle](https://img.shields.io/badge/Gradle-02303A.svg?style=for-the-badge\u0026logo=Gradle\u0026logoColor=white)\n![Apache Maven](https://img.shields.io/badge/Apache%20Maven-C71A36?style=for-the-badge\u0026logo=Apache%20Maven\u0026logoColor=white)\n![Neovim](https://img.shields.io/badge/NeoVim-%2357A143.svg?\u0026style=for-the-badge\u0026logo=neovim\u0026logoColor=white)\n![Lua](https://img.shields.io/badge/lua-%232C2D72.svg?style=for-the-badge\u0026logo=lua\u0026logoColor=white)\n\n![Linux](https://img.shields.io/badge/Linux-FCC624?style=for-the-badge\u0026logo=linux\u0026logoColor=black)\n![Windows](https://img.shields.io/badge/Windows-0078D6?style=for-the-badge\u0026logo=windows11\u0026logoColor=white)\n![macOS](https://img.shields.io/badge/macOS-000000?style=for-the-badge\u0026logo=apple\u0026logoColor=white)\n\n---\n\nJust install and start writing `public static void main(String[] args)`.\n\n---\n\n\u003e [!TIP]\n\u003e You can find cool tips \u0026 tricks here https://github.com/nvim-java/nvim-java/wiki/Tips-\u0026-Tricks\n\n## :loudspeaker: Demo\n\n\u003chttps://github.com/nvim-java/nvim-java/assets/18459807/047c8c46-9a0a-4869-b342-d5c2e15647bc\u003e\n\n## :dizzy: Features\n\n- :white_check_mark: Spring Boot Tools\n- :white_check_mark: Diagnostics \u0026 Auto Completion\n- :white_check_mark: Automatic Debug Configuration\n- :white_check_mark: Organize Imports \u0026 Code Formatting\n- :white_check_mark: Running Tests\n- :white_check_mark: Run \u0026 Debug Profiles\n- :white_check_mark: Built-in Application Runner with Log Viewer\n- :white_check_mark: Profile Management UI\n- :white_check_mark: Decompiler Support\n- :white_check_mark: [Code Actions](https://github.com/nvim-java/nvim-java/wiki/Tips-\u0026-Tricks#running-code-actions)\n\n## :hammer: How to Install\n\n\u003cdetails\u003e\n\n\u003csummary\u003e:small_orange_diamond:details\u003c/summary\u003e\n\n**Requirements:** Neovim 0.11.5+\n\n### Using `vim.pack`\n\n```lua\nvim.pack.add({\n  {\n    src = 'https://github.com/JavaHello/spring-boot.nvim',\n    version = '218c0c26c14d99feca778e4d13f5ec3e8b1b60f0',\n  },\n  'https://github.com/MunifTanjim/nui.nvim',\n  'https://github.com/mfussenegger/nvim-dap',\n\n  'https://github.com/nvim-java/nvim-java',\n})\n\nrequire('java').setup()\nvim.lsp.enable('jdtls')\n```\n\n### Using `lazy.nvim`\n\nInstall using [lazy.nvim](https://github.com/folke/lazy.nvim):\n\n```lua\n{\n  'nvim-java/nvim-java',\n  config = function()\n    require('java').setup()\n    vim.lsp.enable('jdtls')\n  end,\n}\n```\n\nYep! That's all :)\n\n\u003c/details\u003e\n\n## :keyboard: Commands\n\n\u003cdetails\u003e\n\n\u003csummary\u003e:small_orange_diamond:details\u003c/summary\u003e\n\n### Build\n\n- `JavaBuildBuildWorkspace` - Runs a full workspace build\n\n- `JavaBuildCleanWorkspace` - Clear the workspace cache\n  (for now you have to close and reopen to restart the language server after\n  the deletion)\n\n### Runner\n\n- `JavaRunnerRunMain` - Runs the application or selected main class (if there\n  are multiple main classes)\n\n```vim\n:JavaRunnerRunMain\n:JavaRunnerRunMain \u003carguments\u003e \u003cto\u003e \u003cpass\u003e\n```\n\n- `JavaRunnerStopMain` - Stops the running application\n- `JavaRunnerToggleLogs` - Toggle between show \u0026 hide runner log window\n\n### DAP\n\n- `JavaDapConfig` - DAP is autoconfigured on start up, but in case you want to\n  force configure it again, you can use this API\n\n### Test\n\n- `JavaTestRunCurrentClass` - Run the test class in the active buffer\n- `JavaTestDebugCurrentClass` - Debug the test class in the active buffer\n- `JavaTestRunCurrentMethod` - Run the test method on the cursor\n- `JavaTestDebugCurrentMethod` - Debug the test method on the cursor\n- `JavaTestViewLastReport` - Open the last test report in a popup window\n\n### Profiles\n\n- `JavaProfile` - Opens the profiles UI\n\n### Refactor\n\n- `JavaRefactorExtractVariable` - Create a variable from value at cursor/selection\n- `JavaRefactorExtractVariableAllOccurrence` - Create a variable for all\n  occurrences from value at cursor/selection\n- `JavaRefactorExtractConstant` - Create a constant from the value at cursor/selection\n- `JavaRefactorExtractMethod` - Create a method from the value at cursor/selection\n- `JavaRefactorExtractField` - Create a field from the value at cursor/selection\n\n### Settings\n\n- `JavaSettingsChangeRuntime` - Change the JDK version to another\n\n\u003c/details\u003e\n\n## :computer: APIs\n\n\u003cdetails\u003e\n\n\u003csummary\u003e:small_orange_diamond:details\u003c/summary\u003e\n\n### Build\n\n- `build.build_workspace` - Runs a full workspace build\n\n```lua\nrequire('java').build.build_workspace()\n```\n\n- `build.clean_workspace` - Clear the workspace cache\n  (for now you have to close and reopen to restart the language server after\n  the deletion)\n\n```lua\nrequire('java').build.clean_workspace()\n```\n\n### Runner\n\n- `built_in.run_app` - Runs the application or selected main class (if there\n  are multiple main classes)\n\n```lua\nrequire('java').runner.built_in.run_app({})\nrequire('java').runner.built_in.run_app({'arguments', 'to', 'pass', 'to', 'main'})\n```\n\n- `built_in.stop_app` - Stops the running application\n\n```lua\nrequire('java').runner.built_in.stop_app()\n```\n\n- `built_in.toggle_logs` - Toggle between show \u0026 hide runner log window\n\n```lua\nrequire('java').runner.built_in.toggle_logs()\n```\n\n### DAP\n\n- `config_dap` - DAP is autoconfigured on start up, but in case you want to force\n  configure it again, you can use this API\n\n```lua\nrequire('java').dap.config_dap()\n```\n\n### Test\n\n- `run_current_class` - Run the test class in the active buffer\n\n```lua\nrequire('java').test.run_current_class()\n```\n\n- `debug_current_class` - Debug the test class in the active buffer\n\n```lua\nrequire('java').test.debug_current_class()\n```\n\n- `run_current_method` - Run the test method on the cursor\n\n```lua\nrequire('java').test.run_current_method()\n```\n\n- `debug_current_method` - Debug the test method on the cursor\n\n```lua\nrequire('java').test.debug_current_method()\n```\n\n- `view_report` - Open the last test report in a popup window\n\n```lua\nrequire('java').test.view_last_report()\n```\n\n### Profiles\n\n```lua\nrequire('java').profile.ui()\n```\n\n### Refactor\n\n- `extract_variable` - Create a variable from value at cursor/selection\n\n```lua\nrequire('java').refactor.extract_variable()\n```\n\n- `extract_variable_all_occurrence` - Create a variable for all occurrences from\n  value at cursor/selection\n\n```lua\nrequire('java').refactor.extract_variable_all_occurrence()\n```\n\n- `extract_constant` - Create a constant from the value at cursor/selection\n\n```lua\nrequire('java').refactor.extract_constant()\n```\n\n- `extract_method` - Create method from the value at cursor/selection\n\n```lua\nrequire('java').refactor.extract_method()\n```\n\n- `extract_field` - Create a field from the value at cursor/selection\n\n```lua\nrequire('java').refactor.extract_field()\n```\n\n### Settings\n\n- `change_runtime` - Change the JDK version to another\n\n```lua\nrequire('java').settings.change_runtime()\n```\n\n\u003c/details\u003e\n\n## :clamp: How to Use JDK X.X Version?\n\n\u003cdetails\u003e\n  \n\u003csummary\u003e:small_orange_diamond:details\u003c/summary\u003e\n\nUse `vim.lsp.config()` to override the default JDTLS settings:\n\n```lua\nvim.lsp.config('jdtls', {\n  settings = {\n    java = {\n      configuration = {\n        runtimes = {\n          {\n            name = \"JavaSE-21\",\n            path = \"/opt/jdk-21\",\n            default = true,\n          }\n        }\n      }\n    }\n  }\n})\n```\n\n\u003c/details\u003e\n\n## :wrench: Configuration\n\n\u003cdetails\u003e\n\n\u003csummary\u003e:small_orange_diamond:details\u003c/summary\u003e\n\nFor most users changing the default configuration is not necessary. But if you\nwant, following options are available:\n\n```lua\nrequire('java').setup({\n  -- Startup checks\n  checks = {\n    nvim_version = true,        -- Check Neovim version\n    nvim_jdtls_conflict = true, -- Check for nvim-jdtls conflict\n  },\n\n  -- JDTLS configuration\n  jdtls = {\n    version = '1.43.0',\n  },\n\n  -- Extensions\n  lombok = {\n    enable = true,\n    version = '1.18.40',\n  },\n\n  java_test = {\n    enable = true,\n    version = '0.40.1',\n  },\n\n  java_debug_adapter = {\n    enable = true,\n    version = '0.58.2',\n  },\n\n  spring_boot_tools = {\n    enable = true,\n    version = '1.55.1',\n  },\n\n  -- JDK installation\n  jdk = {\n    auto_install = true,\n    version = '17',\n  },\n\n  -- Logging\n  log = {\n    use_console = true,\n    use_file = true,\n    level = 'info',\n    log_file = vim.fn.stdpath('state') .. '/nvim-java.log',\n    max_lines = 1000,\n    show_location = false,\n  },\n})\n```\n\n\u003c/details\u003e\n\n## :golf: Architecture\n\n\u003cdetails\u003e\n\n\u003csummary\u003e:small_orange_diamond:details\u003c/summary\u003e\n\nFollowing is the high level idea. Jdtls is the language server nvim-java\ncommunicates with. However, we don't have all the features we need just in\nJdtls. So, we are loading java-test \u0026 java-debug-adapter extensions when we\nlaunch Jdtls. Once the language server is started, we communicate with the\nlanguage server to do stuff.\n\nFor instance, to run the current test,\n\n- Request Jdtls for test classes\n- Request Jdtls for class paths, module paths, java executable\n- Request Jdtls to start a debug session and send the port of the session back\n- Prepare TCP connections to listen to the test results\n- Start nvim-dap and let user interactions to be handled by nvim-dap\n- Parse the test results as they come in\n- Once the execution is done, open a window show the test results\n\n```text\n  ┌────────────┐                         ┌────────────┐\n  │            │                         │            │\n  │   Neovim   │                         │   VSCode   │\n  │            │                         │            │\n  └─────▲──────┘                         └──────▲─────┘\n        │                                       │\n        │                                       │\n        │                                       │\n        │                                       │\n┌───────▼───────┐                ┌──────────────▼──────────────┐\n│               │                │                             │\n│   nvim-java   │                │   Extension Pack for Java   │\n│               │                │                             │\n└───────▲───────┘                └──────────────▲──────────────┘\n        │                                       │\n        │                                       │\n        │                                       │\n        │                                       │\n        │                                       │\n        │              ┌───────────┐            │\n        │              │           │            │\n        └──────────────►   JDTLS   ◄────────────┘\n                       │           │\n                       └───▲───▲───┘\n                           │   │\n                           │   │\n                           │   │\n                           │   │\n                           │   │\n  ┌───────────────┐        │   │         ┌────────────────────────┐\n  │               │        │   │         │                        │\n  │   java-test   ◄────────┘   └─────────►   java-debug-adapter   │\n  │               │                      │                        │\n  └───────────────┘                      └────────────────────────┘\n```\n\n\u003c/details\u003e\n\n## :bookmark_tabs: Projects Acknowledgement\n\n- [spring-boot.nvim](https://github.com/JavaHello/spring-boot.nvim) is the one\n  that starts sts4 \u0026 do other necessary `jdtls` `sts4` sync command registration\n  in `nvim-java`.\n\n- [nvim-jdtls](https://github.com/mfussenegger/nvim-jdtls) is a plugin that follows\n  \"Keep it simple, stupid!\" approach. If you love customizing things by yourself,\n  then give nvim-jdtls a try.\n","funding_links":["https://github.com/sponsors/s1n7ax","https://patreon.com/s1n7ax"],"categories":["Programming Languages Support","Lua","Recently Updated"],"sub_categories":["Diagnostics","(requires Neovim 0.5)","[Dec 11, 2024](/content/2024/12/11/README.md)"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvim-java%2Fnvim-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnvim-java%2Fnvim-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvim-java%2Fnvim-java/lists"}