| name | eclipse-jdtls-setup |
| description | Guide for installing and configuring Eclipse JDT Language Server (JDTLS) for Java development. Use this skill when the user needs help setting up Java language support, troubleshooting JDTLS issues, or configuring their Java development environment. |
Eclipse JDTLS Setup Guide
You are an expert at setting up Eclipse JDT Language Server for Java development across Windows, macOS, and Linux.
Prerequisites
- Java 21 or later must be installed. Verify with
java -version.
- Set
JAVA_HOME to point to your JDK installation.
Automatic Download
The launcher scripts included with this plugin automatically download Eclipse JDTLS from https://download.eclipse.org/jdtls/milestones/ if it is not already installed. The scripts:
- Check
JDTLS_HOME and common installation paths
- If not found, detect the latest milestone version
- Download and extract to
~/.local/share/jdtls (macOS/Linux) or %LOCALAPPDATA%\jdtls (Windows)
- Fall back to manual instructions only if the download fails
Manual Installation (Fallback)
If auto-download fails (e.g., no internet, firewall restrictions), install manually:
macOS (Homebrew)
brew install jdtls
macOS / Linux (Manual Download)
- Download the latest milestone from https://download.eclipse.org/jdtls/milestones/
- Extract to a directory, for example
~/.local/share/jdtls
- Set environment variable:
export JDTLS_HOME=~/.local/share/jdtls
- Add to your shell profile (
~/.bashrc, ~/.zshrc, etc.)
Windows (Manual Download)
- Download the latest milestone from https://download.eclipse.org/jdtls/milestones/
- Extract to a directory, for example
%LOCALAPPDATA%\jdtls
- Set environment variable:
JDTLS_HOME=%LOCALAPPDATA%\jdtls
Linux (Package Manager)
Some distributions provide JDTLS packages:
- Arch Linux:
pacman -S jdtls
- Other distributions: Check your package repository for
jdtls or eclipse-jdt-ls
Verifying the Installation
After installation, verify that the plugins/ directory exists inside your JDTLS installation and contains org.eclipse.equinox.launcher_*.jar.
ls $JDTLS_HOME/plugins/org.eclipse.equinox.launcher_*.jar
LSP Configuration for Copilot CLI
This plugin automatically configures JDTLS via the bundled bin/launch-jdtls bash script (macOS/Linux). The script auto-detects your platform and JDTLS location โ no Python wrapper needed.
Windows users must override the config in ~/.copilot/lsp-config.json to use the PowerShell launcher:
{
"lspServers": {
"eclipse-jdtls": {
"command": "powershell",
"args": ["-ExecutionPolicy", "Bypass", "-File", "C:\\Users\\YOU\\.copilot\\state\\installed-plugins\\eclipse-jdtls\\bin\\launch-jdtls.ps1"],
"fileExtensions": {
".java": "java"
}
}
}
}
Troubleshooting
"Java not found"
- Ensure Java 21+ is installed:
java -version
- Set
JAVA_HOME environment variable to your JDK path
"Eclipse JDTLS not found"
- Set the
JDTLS_HOME environment variable to the JDTLS installation directory
- Ensure the directory contains a
plugins/ subdirectory with the launcher JAR
"Configuration directory not found"
- Verify that
config_linux/, config_mac/, or config_win/ exists in $JDTLS_HOME
- Re-download JDTLS if these directories are missing
No completions or diagnostics
- Ensure the project root contains
pom.xml or build.gradle
- For Maven projects, run
./mvnw dependency:resolve (or mvn dependency:resolve if no wrapper) to populate the local cache
- For Gradle projects, run
./gradlew build (or gradle build if no wrapper) once to populate the local cache
- Check JDTLS logs for errors
Memory issues
- Increase heap size by setting
JAVA_OPTS=-Xmx2G before launching
- Large projects may need 2-4 GB of heap space