[フレーム]
BT

InfoQ Software Architects' Newsletter

A monthly overview of things you need to know as an architect or aspiring architect.

View an example

We protect your privacy.

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Unlock the full InfoQ experience

Unlock the full InfoQ experience by logging in! Stay updated with your favorite authors and topics, engage with content, and download exclusive resources.

Log In
or

Don't have an InfoQ account?

Register
  • Stay updated on topics and peers that matter to youReceive instant alerts on the latest insights and trends.
  • Quickly access free resources for continuous learningMinibooks, videos with transcripts, and training materials.
  • Save articles and read at anytimeBookmark articles to read whenever youre ready.

Topics

Choose your language

InfoQ Homepage News Oracle Java Platform Extension for VSCode Delivers Comprehensive Support for Java Applications

Oracle Java Platform Extension for VSCode Delivers Comprehensive Support for Java Applications

Dec 19, 2023 2 min read

Write for InfoQ

Feed your curiosity. Help 550k+ global
senior developers
each month stay ahead.
Get in touch

Oracle has introduced the Oracle Java Platform Extension for Visual Studio Code for building, running and debugging Java applications using JDK 11 or newer for developers who use Visual Studio Code.

The extension can be installed in Visual Studio Code via Code | Settings | Extensions or by pressing CTRL-P to launch the VS Code Quick Open, then copy the command, ext install Oracle.oracle-java, and press Enter.

Afterwards, the extension makes it possible to install a new JDK or select an existing JDK from the filesystem via View | Command Palette | Download, install and use JDK. The selected JDK will be used to run the extension, but also to build, run and debug projects.

The extension searches for a JDK in the following locations: the jdk.jdkhome and java.home properties, the JDK_HOME and JAVA_HOMEenvironment variables, and the system path.

Profiles can be used for each Java runtime version, especially when using multiple Java versions on the same machine. Each profile has a settings.json file, which can be configured via Code | Settings | Profiles | Edit Profile, and contains configuration such as the jdk.jdkhome property.

New projects may be created via View | Command Palette | Java: New Project and existing Maven and Gradle projects can be imported.

Running or debugging an application is possible via Run main | Debug. Optionally, the launch configuration may be changed by choosing Java+... from the dropdown list and then clicking on the run icon. Various options may be configured via the Run Configuration panel of the Explorer view in order to change the environment variables, VM options, working directory and arguments for the process.

The .vscode/launch.json file specifies the default launch configurations such as the mainClass. A debugger action may be attached in the launch configuration by selecting a local process or a port.

A test can be created by clicking on a light bulb and clicking on Create Test Class. This generates tests which are either empty or failing. The Test Explorer view allows running all the tests, or specific tests.

Generating code such as a constructor, logger and toString() method is possible via the Source Action context menu . Typing /** above a method triggers the extension to create JavaDoc. Right clicking on code and then clicking on Change All Occurrences allows changing the same code in multiple places.

More details may be found in this YouTube video by Ana-Maria Mihalceanu, senior developer advocate at Oracle, as she explains the various features of Oracle's Java Platform extension for Visual Studio Code.

About the Author

Johan Janssen

Show moreShow less

Rate this Article

Adoption
Style

This content is in the Java topic

Related Topics:

Related Content

The InfoQ Newsletter

A round-up of last week’s content on InfoQ sent out every Tuesday. Join a community of over 250,000 senior developers. View an example

We protect your privacy.

BT

AltStyle によって変換されたページ (->オリジナル) /