Payara Micro VSCode Tooling

Uncategorized

 

In this tutorial, I will explain how to create, run and debug a Payara Micro application in Visual Studio Code. (If you’re interested in learning more about using Payara Server in VSCode, please checkout ourprevious blogs.)

Prerequisite VSCode Extensions

Before going through this tutorial, you must install the following extensions from the Visual Studio Code marketplace:

You can install extensions from Extensions view (Ctrl + Shift + X) in the activity bar of VS Code:payara tools

Creating a Payara Micro Application

Maven is the most widely used project build and dependency management tool in the Java ecosystem. So in this tutorial we will generate a Payara Micro Maven Web Application through the Payara Micro Maven archetype.

Let’s start:

  • Open the command pallet using Ctrl + Shift + P, type Payara Micro and select the Generate a Payara Micro Project option:
payara micro maven web application
  • Answer the prompts (groupId, artifactId, etc) to set up the project:
set up the project in maven
  • Enter the context path of application:
Enter the context path of application:
  • Select the Payara Micro version:
Select the Payara Micro version:
  • Select the destination folder, where the project will be generated. Once the project is generated, you may either add the project to the current workspace or open in a new window:
srcmainjava and srcmainwebapp folder
  • As you can see, the project has a basic structure with srcmainjava and srcmainwebapp folders:
project has a basic structure

Running the Payara Micro Application:

  • In the explorer sidebar (or Payara activity bar), expand Payara Micro Instances, right click on the instance and select start:
expand Payara Micro Instances
  • After starting the instance, you may see the Payara Micro application log in the OUTPUT window:
Payara Micro application log in the OUTPUT window
  • Similarly you may also start the instance in the debug mode and you may also modify the debug configuration from the launch.json config named “payara-micro”.
start the instance in the debug mode

Advanced Settings

JDK Home Path

To modify the JDK Home Path of the application, right click on the Payara Micro instance, select JDK Home and browse the JDK Home path:

modify the JDK Home Path of the application

You may also modify the jdk home path setting from the settings.json by updating the java.home property.

modify the jdk home path setting from the settings.json

Customize Build Commands:

Payara Micro application lifecycle commands like start, stop, reload and bundle can be modified as per developer choice by overriding these command instructions in the tasks.json.

commands like start, stop, reload and bundle can be modified

Now that we can run Payara Micro applications without leaving VSCode, it’s time to write some code! For inspiration, check out the Payara Examples repository on GitHub for some sample applications.

Download Payara Micro
{{cta(‘908761da-2736-4afd-b6e5-023e5a101b91’)}}

 

 

Comments (6)

Post a comment

Your email address will not be published. Required fields are marked *

Payara needs the contact information you provide to us to contact you about our products and services. You may unsubscribe from these communications at any time. For information on how to unsubscribe, as well as our privacy practices and commitment to protecting your privacy, please review our Legal & Privacy Policy.

  1. Humberto Dias

    Great extension, works really well with the standalone version!
    Would be great if this extension were also supported by visual studio online – https://github.com/cdr/code-server

    Imagine to have a embedded online ide with hot deployment of my payara micro project 😉

  2. Humberto Dias

    Using this extension on vscode online
    https://github.com/humbertodias/payara-ide
    Thanks

  3. Gaurav Gupta

    Hi Humberto, Thanks for using the Payara tools and sharing the info for code-server, we will review and update.

  4. Shane McKee

    Thanks for the blog! I followed all of the instructions and everything completed with out error. All of the maven plugins and dependencies look fine. When I expand the Payara Micro Instances pane on the left there is not a Payara Micro Instance. I have tried a couple different versions of the archetype but none of them end up creating an instance. Am I missing a step or is there a manual way to add the instance?

  5. Gaurav Gupta

    Hi Shane,

    Use payara-micro-maven-archetype to create the Payara Micro project, Payara VSCode tools already supports generating new Payara Micro project. If the Payara Micro instance is not visible in the side panel then check the existence of the payara-micro-maven-plugin in pom.xml and also share the log from the Developer console (F12) for further assistance.

  6. Sergius

    How to configure maven home? payara tool says to me something like “error execute maven because maven home not found”. indeed my system doesn’t have maven_home, m2_home, etc. but maven works fine outside vscode.

Related Posts

Community_Announcement 4 minutes
Uncategorized

Leading the Way: Payara Platform Community 7 Beta Now Fully Jakarta EE 11 Certified

We’re excited to announce that Payara Platform Community 7 Beta application server is now fully certified as Jakarta EE 11 […]

Blue background with coral and fish. Left text: 'MONTHLY CATCH'. Right: laptop screen with tech tabs and Payara Community logo. 4 minutes
Community

The Payara Monthly Catch – August 2025

Welcome aboard the August 2025 issue of The Payara Monthly Catch! With summer in full swing, things may have felt […]

What Is a Java Application Server? A Short Guide 6 minutes
Jakarta EE

What Is a Java Application Server? A Short Guide

Enterprise Java applications power global commerce, healthcare, government and countless other industries. These systems must be scalable, secure and […]