News

VS Code Java Team Details 5 Best Dev Practices

Microsoft's Visual Studio Code team for Java development added a new Coding Pack for Java installer and detailed best practices for setting up a development environment.

Support for Java in Visual Studio Code is provided through a wide range of extensions, many of which are bundled in the Java Extension Pack.

Coding Pack for Java
[Click on image for larger view.] Coding Pack for Java (source: Microsoft).

The new Coding Pack for Java, meanwhile, installs VS Code, the AdoptOpenJDK Java Development Kit (JDK) and the "essential Java extensions" found in the Java Extension Pack. It can be used for a brand-new clean installation or for updating or repairing an existing development environment. The installer is available for Windows and for macOS, but be warned that clicking on those links may start an automatic download.

Along with announcing the new Coding Pack for Java installer, Yaojin Yang, senior program manager in the Developer Division at Microsoft, detailed five best practices for initial setup of a development environment, starting off with using the Coding Pack for Java. "When installation completes, you immediately have an integrated environment for your Java projects," he said. "The pack supports incremental updates by checking your environment firstly and only installs required pieces."

After explaining how VS Code uses two JDKs, boot (for running VS Code for Java) and project (for building projects), Yang listed other best practices including:
  • Check the "java.home" VS Code setting to ensure it points to a JDK with Java 11 or above if you have trouble with running VS Code for Java. To access that setting click on the menu item titled "File->Preferences->Settings" and search for "java.home" on the "User" tab.
  • Configure your project JDK using the VS Code setting "java.configuration.runtimes" found by clicking on the "File->Preferences->Settings" menu item and searching for "java.configuration.runtimes" on the "User" tab. "You can set multiple JDK versions, and VS Code will pick the best version per your default or project’s source level," Yang said.
  • Install the Java Extension Pack instead of installing individual extensions if you are coding on a Linux machine and thus can't use the Coding Pack for Java installer or otherwise just want to follow a manual process instead.
  • Use the Extension Guide for functionality not found in the Java Extension Pack, including adding more framework support, application server support or utility functions. To launch the wizard-like guide that recommends and installs extensions for specific functionality, click the "View->Command Palette ..." menu item and type in "Java: Extension Guide" in the pallette, which can also be launched by the CTRL+Shift+P keyboard command sequence.

Yang also provided advice on using the Project View that was introduced back in August along with the Extension Guide as part of an effort to improve the "getting started" experience.

See Yang's Oct. 15 blog post for more details on the above, along with advice for using different options to trigger "run or debug" and useful documentation such as:

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

  • Mastering Blazor Authentication and Authorization

    At the Visual Studio Live! @ Microsoft HQ developer conference set for August, Rockford Lhotka will explain the ins and outs of authentication across Blazor Server, WebAssembly, and .NET MAUI Hybrid apps, and show how to use identity and claims to customize application behavior through fine-grained authorization.

  • Linear Support Vector Regression from Scratch Using C# with Evolutionary Training

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the linear support vector regression (linear SVR) technique, where the goal is to predict a single numeric value. A linear SVR model uses an unusual error/loss function and cannot be trained using standard simple techniques, and so evolutionary optimization training is used.

  • Low-Code Report Says AI Will Enhance, Not Replace DIY Dev Tools

    Along with replacing software developers and possibly killing humanity, advanced AI is seen by many as a death knell for the do-it-yourself, low-code/no-code tooling industry, but a new report belies that notion.

  • Vibe Coding with Latest Visual Studio Preview

    Microsoft's latest Visual Studio preview facilitates "vibe coding," where developers mainly use GitHub Copilot AI to do all the programming in accordance with spoken or typed instructions.

  • Steve Sanderson Previews AI App Dev: Small Models, Agents and a Blazor Voice Assistant

    Blazor creator Steve Sanderson presented a keynote at the recent NDC London 2025 conference where he previewed the future of .NET application development with smaller AI models and autonomous agents, along with showcasing a new Blazor voice assistant project demonstrating cutting-edge functionality.

Subscribe on YouTube