Payara Server tools in Eclipse IDE

Using the Payara Tools Eclipse plugin, you can integrate Payara Server within the Eclipse IDE and perform the following tasks:

  • Start and stop the Payara Server from within the IDE

  • Define the Java runtime to be used by Payara Server

  • Deploy an application from within the IDE

  • Launch the admin console within the IDE

  • View the server logs from the IDE

  • Auto Publish & Hot Deploy your application

Adding Payara Server to Eclipse IDE

  1. Open the Servers view (if not visible, it should be under menu Window → Show View → Servers).

    New Server menu
  2. Select Payara → Payara and set the Host name and some comprehensible Server name.

    New Server window
  3. Then click Next to another window with server runtime configuration.

    New Server Runtime
  4. Then click Next again to window with the configuration of the domain. In this example we use domain without configured admin user and the server is not started in debug mode.

    New Server Instance
  5. In the last step you can select resources which will be deployed on the server. Here we don’t have any deployable projects in the workspace yet, so both panels are empty.

    New Server Resources

Adding Resources to Server

  1. First import or create some project, deployable to the Payara Server. Here we use one of the Java EE 7 Samples .

  2. Right-click the target server in the Servers view and click Add and Remove…​

    Add and Remove menu
  3. Select resources you want to be managed by the Payara Tools, add them to the right panel and click Finish.

    Add and Remove window
  4. Now you can watch the deployment of the application in the Console view.

    Add and Remove window
  5. If the deployment was successful, you can use the application. Here we simply opened the internal Eclipse’s browser and sent the HTTP GET request - and the application responded.

    Request and Response in Browser
  6. You can also access the administration console directly from the Eclipse Browser. Just right-click the target server in the Servers view and click Payara → View Admin Console

    Admin Console
    Admin Console

Runtime Reconfiguration

  1. In the Servers view double-click the server you want to reconfigure. The Server Overview will open.

    Server Overview
  2. Click on Runtime Environment and you will see well known window.

    Changing the runtime may result in unusable state of the server because of incompatible configuration.
    Runtime Configuration

Deploy Applications in a Local Docker Container

The Payara Server tools for Apache NetBeans include Docker integration, making it seamless to deploy exploded applications to a Payara Server instance running within a local Docker container.

To take advantage of this feature, follow these steps below:

  1. Register a new Payara Server instance by performing the following:

    1. Open the Servers view (if not visible, it should be under menu Window → Show View → Servers).

    2. Select Payara → Payara and set the Host name and some comprehensible Server name.

    3. Then click Next to another window with server runtime configuration and browse and locate the Payara Server installation directory with the same version as the one running in the Docker container.

    4. Then click Next again to window with the configuration of the domain. Enter the domain name, host, and necessary credentials.

    5. For Docker integration, choose the "Docker Volume" option and provide the HOST_PATH (e.g., D:/test) and CONTAINER_PATH (e.g., /mnt/test) mapping details.

      This mapping should align with the exploded application path or parent path of exploded application.

    6. In the last step you can select resources which will be deployed on the server. You may add them later.

  2. Run the Payara Server Docker container using the following command:

    docker run -p 8080:8080 -p 4848:4848 -p 9009:9009 -v HOST_PATH:CONTAINER_PATH  payara/server-full:{page-version}

    Replace HOST_PATH with the actual host path and CONTAINER_PATH with the desired container path.

    The HOST_PATH points to the location on your host machine, and CONTAINER_PATH is the corresponding location inside the container.

  3. Create your web application and deploy it to the registered Payara Server instance.

Deploy Applications in a WSL Environment

Another noteworthy feature is the integration of the Payara Server Tools with Windows Subsystem for Linux (WSL).

This integration empowers developers to manage and deploy exploded applications to a Payara Server instance running within WSL.

Here’s how you can make use of this feature:

  1. Start the Payara Server instance within WSL:

    1. Run the following command to start the server:

      ./asadmin start-domain
    2. Set a password for the admin user:

      ./asadmin change-admin-password
    3. Enable secure admin:

      ./asadmin enable-secure-admin
    4. Restart the Payara Server domain:

      ./asadmin restart-domain
    5. Fetch the IP address of WSL environment using the command hostname -I and enter it in the host name field in the Eclipse IDE settings.

  2. Register the WSL-based Payara Server instance in VS Code:

    1. Open the Servers view (if not visible, it should be under menu Window → Show View → Servers).

    2. Select Payara → Payara and set the Host name and some comprehensible Server name.

    3. Then click Next to another window with server runtime configuration and browse and locate the Payara Server installation directory with the same version as the one running in the Docker container.

    4. Then click Next again to window with the configuration of the domain. Enter the domain name, host name (fetched via the command hostname -I in WSL instance), and necessary credentials.

    5. For WSL integration, choose the "WSL" instance type.

    6. In the last step you can select resources which will be deployed on the server. You may add this setting later.

  3. Create your web application and deploy it to the registered Payara Server instance.

Hot Deploy and Auto Deploy Settings

To enable Auto Deploy from the Eclipse IDE, open The Server panel, double-click the server name and expand the Publishing section to reconfigure the setting.

Auto Publish applications

Hot Deploy mode can be enabled from the Payara Server properties page to boost the deployment performance which reuses the existing application instance relative to the modified source:

Payara Server Hot Deploy