News

Visual Studio Code Editor Gets New Extensions for Java Programming

The Visual Studio Code team continues to add Java functionality to Microsoft's open source, cross-platform code editor via extensions, just launching a new batch for working with Maven, Tomcat and Checkstyle.

Previously, Microsoft introduced, open sourced and improved a popular Debugger for Java extension, downloaded more than 451,000 times. It also published an extension that added support for the JUnit unit testing framework.

The company's efforts to infuse Java goodness into VS Code might stem from the tremendous popularity of the Language Support for Java (preview) extension by Red Hat, with which the Java debugger works. Downloaded more than 2.1 million times, that extension provides Java support via the Eclipse JDT Language Server implementation of the Language Server Protocol.

The Language Server Protocol, actually originated by Microsoft, "is used between a tool (the client) and a language smartness provider (the server) to integrate features like auto complete, goto definition, find all references and alike into the tool."

Before last week's launch of the three new extensions, the VS Code team announced support for JUnit via the Java Test Runner extension. The lightweight test runner/debugger recognizes JUnit4 tests (support for JUnit 5 is something the team would like to explore, program manager Xiaokai He said), performs run and debug tests and lets developers view test status and run summaries.

The VS Code team also continued to improve the Java debugger, last week announcing the fifth update in the past three months.

Shortly afterward, He followed up by announcing three more Java-related extensions. They are:

  • Maven Project Explorer. The open source Apache Maven is a software project management and comprehension tool used to manage a project's build, reporting and documentation from a central piece of information.

    He said Maven was extremely popular in the Java community and the VS Code team wanted to make it even easier to use by providing functionality in the Project Explorer extension such as:

    • Scanning pom.xml in a workspace and displaying all Maven projects and their modules in the sidebar to make them easy to access.
    • Providing shortcuts to common Maven goals, namely clean, validate, compile, test, package, verify, install site and deploy, which won't need to be typed in the command-line window anymore.
    • Preserving history of custom goals for fast re-run long commands (for example, mvn clean package -DskipTests -Dcheckstyle.skip). He said internal data shows custom goals are very popular among Maven users, so the team believes this will be a useful feature for a developer's repeating tasks.
    • Generating projects from Maven Archetype.

  • Tomcat: This tool is for working with Apache Tomcat, an open source implementation of the Java Servlet, JavaServer Pages, Java Expression Language and Java WebSocket technologies. "With the Tomcat extension, you can manage all your local Tomcat servers within the editor and easily debug and run your war package on Tomcat and link Tomcat into workspace," He said.

  • Checkstyle: According to its SourceForge site, "Checkstyle is a development tool to help programmers write Java code that adheres to a coding standard. It automates the process of checking Java code to spare humans of this boring (but important) task. This makes it ideal for projects that want to enforce a coding standard."

    He added his own description. "Checkstyle is a convenient tool to apply Checkstyle rules to your Java source code so you can see the style issues and fix them on the fly. It automates the process of checking your Java code so you would be freed from this boring task while keeping your format correct."

"If you're trying to find a performant editor for your Java project, please try out those new extensions and let us know what you think!" He concluded. "We plan to keep updating and releasing new extensions to make VS Code a better editor for Java." In the meantime, there are many more Java-related extensions in the Visual Studio Code Marketplace, which you can view here.

About the Author

David Ramel is the editor of Visual Studio Magazine.

Featured

Upcoming Events

AppTrends

Sign up for our newsletter.

I agree to this site's Privacy Policy.