How to install Visual Studio Code for Java

The Java ecosystem has historically been blessed with great IDEs to work with, including NetBeans, Eclipse and IntelliJ from JetBrains.

However, in recent years Microsoft's Visual Studio Code editor has gained steam as a lightweight alternative for Java development. Already prevalent in the JavaScript and TypeScript communities, VS Code is also gaining popularity among Java developers who want to switch between front-end React Apps and back-end Java apps without the need to switch between IDEs.

How to install VS Code for Java

Microsoft has made it incredibly easy to install Visual Studio Code for Java. A developer needs only to download Visual Studio's Java coding pack from Microsoft, and the installer takes care of the rest. Simply accept all the defaults and the VS Code for Java installer performs these tasks for you:

  1. Download and install the JDK.
  2. Download and install Visual Studio Code.
  3. Configure the JUnit and TestNG runner extension.
  4. Download and install Maven.
  5. Install the Java Project Manager extension.

When the installation completes, VS Code will be fully capable to validate source code, create Maven projects, run tests and execute Java classes that have a main method.

Extending Visual Studio Code for Java

Many developers like VS Code for Java for its fast and lightweight nature. However, one of the most compelling features of VS Code is its pluggable architecture that makes it easy for both vendors and independent developers to create extensions for the tool.

To really take their VS Code experience to the next level, developers should explore and install productivity-enhancing plugins or extensions. Some of the most popular include the following:

  • The Spring Tools extension pack.
  • The Gradle plugin for VS Code.
  • Application Server connectors for Tomcat and Jetty.
  • The extension pack for MicroProfile.
  • Static code analysis tools like Checkstyle and SonarQube.

If you've ever wanted to experiment with a new IDE, it's worth dedicating a bit of time to download and install Visual Studio Code for Java. You might find software development in Java feels new and fun again.

Cameron McKenzie has been a Java EE software engineer for 20 years. His current specialties include Agile development; DevOps; Spring; and container-based technologies such as Docker, Swarm and Kubernetes.

View All Videos