Giter Club home page Giter Club logo

vscode-java's Introduction

Language support for Java ™ for Visual Studio Code

Join the chat at https://gitter.im/redhat-developer/vscode-java Build Status Marketplace Version

Provides Java ™ language support via Eclipse ™ JDT Language Server, which utilizes Eclipse ™ JDT, M2Eclipse and Buildship.

Quick Start

  1. Install the Extension
  2. If you do not have a Java Development Kit correctly set
    • Download and install a Java 8 or 9 compatible development kit.
  3. Extension is activated when you first access a Java file
    • Recognizes projects with maven or gradle build files in the directory hierarchy.

Features

 screencast

  • Maven pom.xml project support
  • Basic Gradle Java project support
  • As you type reporting of parsing and compilation errors
  • Code completion
  • Code actions
  • Javadoc hovers
  • Organize imports
  • Type search
  • Code outline
  • Code navigation
  • Code lens (references/implementations)
  • Highlights
  • Code formatting
  • Code snippets

Please note that Gradle-based Android projects are not supported.

To launch and debug your Java programs, it's recommended you install Java Debug Extension for Visual Studio Code.

See the changelog for the latest release. You might also find useful information in the project Wiki.

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

The following commands are available:

  • Java:Update Project configuration (Shift+Alt+U): 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: opens the Java Language Server log file, useful for troubleshooting problems.
  • Java:Force Java compilation (Shift+Alt+B): manually triggers compilation of the workspace.
  • Java:Organize imports (Shift+Alt+O): Organize imports in the currently opened Java file.

Supported VS Code settings

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 are disabled (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 are ignore, 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.
  • java.contentProvider.preferred : Preferred content provider (see 3rd party decompilers available in vscode-java-decompiler).
  • java.import.gradle.enabled : Enable/disable the Gradle importer.
  • java.import.maven.enabled : Enable/disable the Maven importer.
  • java.autobuild.enabled : Enable/disable the 'auto build'.
  • java.completion.favoriteStaticMembers : Defines a list of static members or types with static members.
  • java.completion.importOrder : Defines the sorting order of import statements.

Troubleshooting

  1. 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. Read the troubleshooting guide for collecting informations about issues you might encounter.

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

Feedback

License

EPL 1.0, See LICENSE for more information.

vscode-java's People

Contributors

fbricon avatar gorkem avatar aeschli avatar snjeza avatar yaohaizh avatar mkeller avatar ansyral avatar maxandersen avatar bawachhe avatar dbaeumer avatar jpospychala avatar mrennie avatar pmuir avatar rgcv avatar gitter-badger avatar btstream avatar

Watchers

James Cloos avatar Paul Verest avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.