Java on Visual Studio Code Update – June 2020
Welcome back to the June update of Java on Visual Studio Code.
We are approaching the end of the first half of 2020. In this unforgettable year, we hope you still enjoy many beautiful moments in life and, of course, enjoy the productivity VS Code brings to you. On to the update.
VS Code for Java soon requiring Java 11 to run
VS Code for Java requires the Eclipse JDT.LS server. As a result of the Eclipse Platform’s decision to require Java 11 as the minimum requirement for its September 2020 release, that same requirement will apply to VS Code for Java. We expect the requirement will become effective as early as July 2020 for running VS Code for Java. This is a CALL FOR ACTION to make sure your VS Code for Java runs on Java 11 or above versions before the time comes. For more details on how to check and upgrade, please refer to Configuring your development environment to use a JDK.
Please note, this is NOT a requirement to migrate your projects to Java 11. VS Code for Java will still be possible to compile and run Java applications from Java 1.5 to 14.
Introducing Java pack installer for MacOS
There are many ways to install and set up your Java development environment on VS Code. To help you get started quickly, back to a year ago, we introduced a Java pack installer for Windows, which includes all the necessary dependencies and extensions for Java development on Visual Studio Code. Today, the installer is available on MacOS as well. You can use the installer for a clean installation or an update to existing VS Code environment to add Java support.
For more information on installing and setting up your Java development on VS Code, please refer to our Get Started document.
Code completion for Lightweight Mode
Back to March, we introduced Syntax Mode, which allows you to read and navigate your source code right after open them, while their external dependencies are being resolved. Since that, we have received positive feedback from our developers. Today, we are sharing two news. Syntax mode now supports code completion. Previously, code completion is available only until projects are fully resolved. With this enhancement, code completion will be enabled in about 10 seconds after you open a fresh workspace. In addition, we are renaming Syntax Mode to Lightweight Mode. In transition, you will see both names used interchangeably.
For more information about Lightweight Mode (a.k.a., Syntax Model), please refer to Project Management document.
In June, we released new versions of Maven for Java and Java Test Runner extensions. On Maven for Java, we improved support for PowerShell and fixed a couple of issues. On Java Test Runner, we started to support JUnit 5’s @Testable in Code Lenses. For details, please refer to Maven for Java and Java Test Runner.
FAQ: add jar or classpath
We have received questions around how to add jar or classpath. Actually, VS Code provides flexibility on how, which depends on your project type. As a summary, adding jar or classpath is supported through:
- Maven: Supported by Maven extension
- Gradle: Need to manually update the build.gradle
- Eclipse: Manually update the .classpath file
- Source only: Update the Referenced Libraries in the dependency viewer’s node
In addition, you can always manually update the .classpath file regardless project type.
Try it out
Please don’t hesitate to give it a try! Your feedback and suggestions are very important to us and will help shape our product in future.