Provides Java ™ language support via Eclipse ™ JDT Language Server, which utilizes Eclipse ™ JDT, M2Eclipse and Buildship.
- Install the Extension
- If you do not have a Java 8 Development Kit correctly set
- Download and install a Java 8 compatible development kit.
- Extension is activated when you first access a Java file
- Recognizes projects with maven or gradle build files in the directory hierarchy, or to a lesser extent, simple Eclipse projects, i.e. containing .project and .classpath files.
- Maven pom.xml project support
- Basic Eclipse Java project support
- Basic Gradle Java project support
- As you type reporting of parsing and compilation errors
- Code completion
- Javadoc hovers
- Type search
- Code outline
- Code navigation
- Code lens (references)
- Highlights
- Code formatting
- Code snippets
Please note that Gradle-based Android projects are not supported.
See the changelog for the latest release. You might also find useful information in the project Wiki.
The path to the Java Development Kit is searched in the following order:
- the
java.home
setting in VS Code settings (workspace then user settings) - the
JDK_HOME
environment variable - the
JAVA_HOME
environment variable - on the current system path
The following commands are available:
Java:Update Project configuration
(Ctrl+Alt+U
orCmd+Alt+U
on MacOS): is available when the editor is focused on a Maven pom.xml or a Gradle file. It forces project configuration / classpath updates (eg. dependency changes or Java compilation level), according to the project build descriptor.Java:Open Java Language Server log file
(since 0.4.0): opens the Java Language Server log file, useful for troubleshooting problems.
The following settings are supported:
java.home
: Absolute path to JDK 8 home folder used to launch the Java Language Server. Requires VS Code restart.java.jdt.ls.vmargs
: Extra VM arguments used to launch the Java Language Server. Requires VS Code restart.java.configuration.updateBuildConfiguration
: Specifies how modifications on build files update the Java classpath/configuration. Supported values aredisabled
(nothing happens),interactive
(asks about updating on every modification),automatic
(updating is automatically triggered).java.errors.incompleteClasspath.severity
: Specifies the severity of the message when the classpath is incomplete for a Java file. Supported values areignore
,info
,warning
,error
.java.trace.server
: Traces the communication between VS Code and the Java language server.java.configuration.maven.userSettings
: Absolute path to Maven's settings.xml.java.import.exclusions
: Exclude folders from import via glob patterns.java.referencesCodeLens.enabled
: Enable/disable the references code lenses.java.implementationsCodeLens.enabled
: Enable/disable the implementations code lenses.java.signatureHelp.enabled
: Enable/disable signature help support (triggered on(
).java.format.enabled
: Enable/disable the default Java formatter.
- Check the status of the language tools on the lower right corner (marked with A on image below). It should show ready (thumbs up) as on the image below. You can click on the status and open the language tool logs for further information in case of a failure.
-
Read the troubleshooting guide for collecting informations about issues you might encounter.
-
Report any problems you face to the project.
This is an open source project open to anyone. Contributions are extremely welcome!
For information on getting started, refer to the CONTRIBUTING.md instructions.
Continuous Integration builds can be installed from http://download.jboss.org/jbosstools/jdt.ls/staging/. Download the most recent java-<version>.vsix
file and install it by following the instructions here.
Also, you can contribute your own VSCode extension to enhance the existing features by following the instructions here.
- File a bug in GitHub Issues.
- Tweet us with other feedback.
EPL 1.0, See LICENSE for more information.