Skip to content

minipotato/vscode-java

 
 

Repository files navigation

Build Status Waffle.io Marketplace Version Language support for Java ™ for Visual Studio Code

Provides Java ™ language support via java-language-server, which utilizes Eclipse ™ JDT.

Quick Start

  1. Install the Extension
  2. If you do not have a Java 8 Development Kit correctly set
    • Download and install a Java 8 compatible development kit.
  3. Extension is activated when you first access a Java file.
    • Initial activation can be longer since it requires extension to download additional parts.
    • Recognizes only projects with maven build files on the directory hierarchy, or to a lesser extent, simple Eclipse projects, i.e. containing .project and .classpath files.

Features

 screencast

  • Maven pom.xml project support
  • Basic Eclipse Java project support
  • As you type reporting of parsing and compilation errors
  • Code completion
  • Javadoc hovers
  • Code outline
  • Code navigation
  • Code lens (references)
  • Highlights
  • Code formatting
  • Code snippets

See the changelog for the latest release.

Setting the JDK

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

Available commands

Starting from version 0.0.8, the following command is available:

  • Update Project configuration (Ctrl+Alt+U or Cmd+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.

Supported VS Code settings

Starting from version 0.0.5, 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.

Troubleshooting

  1. Due to size restrictions on the marketplace extension downloads additional required parts check that they are downloaded under ~/.vscode/extensions/redhat.java-0.0.7/server folder. You should see a folder named plugins.

  2. 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.

 status indicator

  1. Report any problems you face to the project.

Contributing

This is an open source project open to anyone. Contributions are extremely welcome

For information on getting started refer to java-language-server.

Feedback

License

EPL 1.0, See LICENSE for more information.

About

Java Language Support for Visual Studio Code

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • TypeScript 98.9%
  • JavaScript 1.1%