News

Java Devs Using Microsoft VS Code: Upgrade to Java 11 Now

Microsoft has issued a "Call for Action" to Java developers using its Visual Studio Code (VS Code) source-code editor to make sure their code runs on Java 11 or above, soon.

VS Code for Java requires the Eclipse JDT Language Server (a.k.a. jdt.ls), which is an open source Java-language-specific implementation of the Language Server Protocol, incubating at the Eclipse Foundation. The Eclipse Project Committee (PMC) decided in March to make Java 11 the minimum requirement for the September 2020 release of the Eclipse Project (v4.17), which includes the JDT. That change, which could go into effect as early as July 2020, means that the Java 11 requirement will apply effectively to VS Code for Java. It also means that VS Code users who do upgrade will be able to use the latest version of the Jetty Java HTTP (Web) server and Java Servlet container, Jetty 11.

"Please note, this is not a requirement to migrate your projects to Java 11," said Yaojin Yang, senior program manager in Microsoft's Developer Division, in a blog post. "VS Code for Java will still be possible to compile and run Java applications from Java 1.5 to 14."

The Eclipse Platform Project is the core and original project of the Eclipse Foundation. (The foundation is home to more than 485 projects as of this writing.) It's a Java-based, extensible, open-source development platform that provides the foundation for the Eclipse IDE.

Microsoft's open-source, cross-platform VS Code relies heavily on language servers like jdt.ls to provide programming-language-specific "smarts," such as source code auto-completion, Go To Definition, Find All References, IntelliSense and so on.

Java 11 was released in September 2018 and has reached 28 percent usage among developers, according to a recent survey.

Details about checking Java SDK versions and upgrading are provided in the "Configuring your development environment to use a JDK" documentation on the Java in VS Code Web site.

The list of enhancements in the June 2020 update, provided via an assortment of extensions, includes:

  • New Java pack installer for macOS: A similar installer, which includes all the necessary dependencies and extensions, was previously available for Windows. The macOS version is available here. (Note: clicking on link may initiate download.)
  • Code completion for Lightweight Mode: This feature boosts Syntax Mode (just renamed Lightweight Mode), which was unveiled in March, and which lets developers read and navigate source code right after a source file or folder is opened, even if external dependencies are still being resolved. Functionality is boosted by the addition of code completion, which previously didn't work until projects were fully resolved. Now, developers can expect code completion within about 10 seconds or so after a fresh workspace is opened.
  • Maven for Java and Java Test Runner extensions: These extensions, recently released in new versions, have new functionality. "On Maven for Java, we improved support for PowerShell and fixed a couple of issues, Yang said in his post. "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."

He also included a short FAQ on how to add jar or classpath to answer developer questions about how that works.

About the Author

David Ramel is an editor and writer for Converge360.