VSCode Java Extension

VSCode Java Extension: A blog on the uses and features of the VSCode Java extension.

The VS Code Java extension has been created by Red Hat (the company I work for), and is available to use free of charge. In this blog I will go through some of my favourite uses, tips, and extensions for working with Java in VS Code.

Installing the plugin

The first thing you need to do is install the Visual Studio Code IDE along with the latest version of JDK (Java Development Kit). I recommend installing the latest LTS release of JDK 8, which you can find here.

I am a huge fan of VSCode and have been using it for over two years now. I enjoy the user experience it provides and the simplicity of use. It has become my go to editor for all programming needs, including Java.

VSCode is a highly customizable editor that allows you to install extensions to customize the experience even further, add features, or otherwise modify your workflow. One extension that I find myself using every day is the VSCode Java Extension Pack by Microsoft. The pack provides all of the essential extensions for developing in Java, including:

Java Language Support

Debugger for Java

Maven Project Explorer

Java Test Runner (JUnit)

Java Dependency Viewer

CheckStyle for Java

Java Code Formatter

SpotBugs (FindBugs) extension

The great thing about this pack is that it is constantly being updated by Microsoft and includes all of the most popular extensions available on the marketplace. This means you can get up and running with a single extension installation and start coding right away without having to worry about which extensions will work well together and which ones need to be installed separately.

Visual Studio Code is an open source IDE developed by Microsoft. The Java extension for Visual Studio Code is being developed by Red Hat and is now available as a Preview release. This blog discusses the features, how to use them, and known issues.

To learn about what’s new in this release see the v0.8.0 release notes. If you encounter problems please file issues in GitHub.

Overview

This extension provides support for debugging Java applications in Visual Studio Code. It supports all features of the Language Support for Java by Red Hat and Debugger for Java extensions, plus some additional ones we’ve added ourselves.

The VSCode Java Extension Pack is a collection of extensions that can be installed together to make VS Code a great Java development environment. The pack includes the Language Support for Java(TM) by RedHat extension that provides comprehensive Java language support, the Debugger for Java(TM) by Microsoft extension that allows you to debug your applications, and the Java Test Runner extension that enables running JUnit tests from VS Code.

In this blog post I will highlight some of the features of these extensions and how they work together to improve your productivity when working with Java code.

If you want to try out these features, download VS Code and install the Java Extension Pack or directly install each extension mentioned in this post from the Marketplace. You can also follow along with me as I demonstrate all of these features in this video.

We have been working on a new extension for Visual Studio Code that we think Java developers are going to love. This extension is currently in preview, so please feel free to try it out and give us your feedback.

A number of our users have asked for the ability to debug their Java applications in VS Code, and with this release we now have a preview of a Java Debugger extension for VS Code. The Java Debugger extension is 100% open source and is available on Github.

The Java Debugger extension provides the ability to debug locally (on your own machine) with or without Docker containers, as well as remotely (on a different machine or in the cloud) using JDWP (Java Debug Wire Protocol). Additionally, the debugger provides the ability to evaluate expressions within the current context of an application.

The java extension for Visual studio code is a great extension to use with Java. It helps to support the language features, such as syntax highlighting and autocomplete. Another great feature of this extension is the ability to launch a Java program. It’s very easy to use, as all you have to do is create a file with the name “launch.json” with the following code:

{

“version”: “0.2.0”,

“configurations”: [

{

“type”: “java”,

“name”: “Debug (Launch)-HelloWorld”,

“request”: “launch”,

“mainClass”: “HelloWorld”

}

]

}

An extension for VS Code which provides support for the Java programming language.

Java 11 support

This extension now supports Java 11. Please note that all JDKs other than Oracle and OpenJDK are untested and unsupported.

Java 8 support will be removed in a future release. We recommend you update to Java 11 as soon as possible.

Javadoc search paths

You can provide a list of Javadoc search paths for your projects, which will be used by the completion engine to resolve Javadoc documentation URLs. This is useful if you have non-standard Javadoc URLs (such as Maven Central or JitPack). Use the java.javadoc.searchPaths setting to configure the Javadoc search paths:

“java.javadoc.searchPaths”: [{“url”:”https://docs.oracle.com/en/java/javase/11/docs/api”, “package”: [“java.*”]}]

The list must contain one or more objects with two properties: url, specifying the base URL to use when resolving Javadoc URLs; and package, specifying a list of package prefixes against which to match classes being resolved.

Leave a Reply