jdtls-launcher
jdtls-launcher copied to clipboard
The simplest way to install and launch JDTLS
JDTLS - Launcher
The simplest way to install and launch Eclipse's JDTLS!!
- Requirements
- Installation
- Automatic installation
- Manual Installation
- Updating
- Uninstall
- Editor configuration
- Neovim with lspconfig
Requirements:
- Java 17+ (available in path)
- Linux, MacOS or WSL
Installation:
Automatic installation:
Important: uninstall any previous installation.
- Script will be installed to
~/.local/opt/jdtls-launcher - A symlink called
jdtlswill be created in~/.local/bin/jdtls
Linux / MacOS / WSL:
- Run the installation script:
curl https://raw.githubusercontent.com/eruizc-dev/jdtls-launcher/master/install.sh | bash - Add
~/.local/binto your path# .bashrc, .zshrc or whatever shell you use export PATH=$PATH:$HOME/.local/bin
Custom install location:
Append -s /path/to/dir to the installation command
- A directory called
jdtls-launcherwill be created inside that directory - A symlink will still be created to the same location
Manual Installation:
- Download source code from releases or directly from the master branch
- Unzip it and place
jdtls-launcher.shscript in your desired install location - Run the script with
--installoption to install jdtls and lombook alongside the script in a directory calledjdtls(user must have write permissions) - Run the script
jdtls-launcher.shwithout arguments to start the language server
Update
To update jdtls and lombook it's as simple as jdtls --update
You can always check what version you have installed with jdtls --version
command.
To update jdtls-launcher you have to manually uninstall and reinstall
Uninstall
Remove symlink and jdtls-launcher directory with rm -rf.
- Symlink locations can be found using
where jdtlsorwhich jdtls - Install location can be found using
dirname $(realpath jdtls)
Editor configuration:
Neovim with lspconfig
Add the following to your init.vim
lua require'lspconfig'.jdtls.setup{
\ cmd = { 'jdtls' },
\ root_dir = function(fname)
\ return require'lspconfig'.util.root_pattern('pom.xml', 'gradle.build', '.git')(fname) or vim.fn.getcwd()
\ end
\}