Skip to content

Commit

Permalink
docs(java): Add tips about setting jdtls runtime (#635)
Browse files Browse the repository at this point in the history
* docs(java): Add tips about setting jdtls runtime

* Update lua/astrocommunity/pack/java/README.md

Co-authored-by: Micah Halter <[email protected]>

---------

Co-authored-by: Micah Halter <[email protected]>
  • Loading branch information
Uzaaft and mehalter authored Nov 11, 2023
1 parent 86cd4fc commit 48d4417
Showing 1 changed file with 30 additions and 4 deletions.
34 changes: 30 additions & 4 deletions lua/astrocommunity/pack/java/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# Java Language Pack

Requires:
Requires:

- `JDK-17` or higher to function.

This plugin pack does the following:
Expand All @@ -11,6 +11,32 @@ This plugin pack does the following:
- Adds `jdtls` language server
- Adds `lemminx` language server (XML)
- Adds [nvim-jdtls](https://github.com/mfussenegger/nvim-jdtls) for language specific tooling
- Enables [hot reloading](https://github.com/mfussenegger/nvim-jdtls/issues/80)
- Enables [hot reloading](https://github.com/mfussenegger/nvim-jdtls/issues/80)
- Adds `clang_format` through null-ls
- Adds `javadbg` and `javatest` debug adapters for nvim-dap
- Adds `javadbg` and `javatest` debug adapters for nvim-dap

## Tips

`jdtls` requires Java 11+ but can be used to develop on any Java version. If you develop using different Java runtimes, you can set the runtimes you have available in the settings of `jdtls`. Here is a simple example:

```lua
"AstroNvim/astrocommunity",
{ import = "astrocommunity.pack.java" },
{
"mfussenegger/nvim-jdtls",
opts = {
settings = {
java = {
configuration = {
runtimes = {
{
name = "JavaSE-11",
path = "/usr/lib/jvm/java-11-openjdk/",
},
},
},
},
},
},
},
```

0 comments on commit 48d4417

Please sign in to comment.