Contributions are essential for keeping this language server great. We try to keep it as easy as possible to contribute changes and we are open to suggestions for making it even easier. There are only a few guidelines that we need contributors to follow.
Below are the details about how to set up the JDT Language Server in different IDEs. Notice: You only need set up it once in any of your preferred IDE.
-
Please install Eclipse PDE support extension in your VS Code first. The PDE extension's home page provides more usage details about Reload Target Platform, Run JUnit Plug-in Test, Run Eclipse Application.
-
Open VS Code on the
eclipse.jdt.ls
folder. The PDE extension will work with Java extension together to automatically load the eclipse.jdt.ls project. Check the status of the language tools on the lower right corner. It should show ready (thumbs up) as the image below.
-
In Eclipse, import a maven project:
Select the
eclipse.jdt.ls
folder, then click yes/accept to all following prompts: -
Now we need to use Tycho to download the dependencies, this will get rid of the errors.
At the top right arrow it will say
Set Target Platform
, select that and continue.After it will change to
Reload Target Platform
select that: -
Wait till the bottom right is done loading:
once 100%:
The errors should now be gone.
-
Please, download Eclipse PDE support, open the
.vsix
file with a ZIP program and extract the folder/extension/server/
into a local directory. -
Ensure that the initialize request contains all paths to the extracted files in the
bundles
parameter.If you are using
nvim-jdtls
, fill thebundles
parameter with all JARs in the extracted folder to enable PDE support.config['init_options'] = { bundles = vim.split(vim.fn.glob("/path/to/extracted/folder/*.jar"), "\n") }
You might have a look at
nvim-jdtls-bundles
that automates the process for you.If you are using Emacs with
lsp-java
, have a look at the configuration optionlsp-java-bundles
. For example, following configuration snippet enables PDE support:(use-package lsp-java :config (setq lsp-java-bundles (directory-files "/path/to/extracted/folder/" t ".jar")) :hook (java-mode . lsp))
In order to submit contributions for review, please make sure you have signed the Eclipse Contributor Agreement (ECA) with your account.
Also, please ensure that your commit contains a Signed-off-by
field with your name and account email in the footer. This is a confirmation that you are aware of the terms under which the contribution is being provided. This can be done with the -s
flag of the git commit
command.