Payara for Beginners – Adding Payara Server to Eclipse IDE

Uncategorized

If you are creating a Java EE project, it is important to have a server defined in Eclipse so you can easily test your applications from the IDE – a much smoother workflow than building an artifact and manually deploying to Payara Server!

{{cta(‘895dc2c7-4891-4bae-94c0-4bcca626e52f’,’justifycenter’)}}

 

To add Payara Server to Eclipse, first make sure that you have Eclipse IDE for Java EE Developers installed. If you’re using Eclipse Oxygen (4.7) or more recent, you can install the Payara Tools plugin for a smoother experience using Payara Server with the Eclipse IDE. Details on installing this plugin can be found here. Alternatively, the GlassFish plugin should work fine for accessing basic server functions. This guide will be using the Payara Tools plugin.

Once you’ve got the IDE setup, add Payara Server using the following steps:

1. Once you have the IDE loaded, open the Servers view by going to Window → Show View → Other:

2. Then select Servers from the menu:

3. Now that you have the servers view click the link to create a new server:

4. Select Payara as the server type in the server definition window and specify both the host name (localhost is fine for development use) and server name. The server name is simply an identifier you can use to differentiate between servers if you want to define a number of them; you may want to include the version in its name.

5. You must now specify the location of the payara5 or glassfish directories within the Payara Server installation and your JDK home directory. In Linux, the JDK directories are under /usr/lib/jvm in most distributions.

7. Finally, specify the details of the domain that you are using. If you have not made any changes to your Payara Server configuration yet then the default values will be sufficient:

8. Payara Server is now ready for use with Eclipse. When creating a new Java EE project, set the target runtime to be Payara Server and to test an application choose Run on Server instead of Java Applet or Java Application:

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

{{cta(‘a591925d-60f3-4d12-9da6-6123459ccf71’)}}

 

 

Comments (5)

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. Patricia

    What causes Payara to crash when adding Glassfish runtime properties? I’m using Eclipse Neon and Linux Mint and I tried everything but nothing works.

    1. Jonathan Coustick

      Please raise this issue on the Payara forums at https://groups.google.com/forum/#!forum/payara-forum

  2. hilal aissani

    I am not able to start Payara on my eclipse . This is the error that I am receiving
    ” Unable to resolve org.glassfish.hk2.osgi-resource-locator ….”
    My Java is JDK 14. Please help me out to solve this problem

  3. Thomas Pries

    Thanks for this post, but today we are at payara 6 and we need an update.

    1. Priya Khaira-Hanks

      Hi, our Eclipse IDE Plugin should support Payara 6 out of the box.

Related Posts

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 […]

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 […]

10 minutes
Uncategorized

Java’s 30th Anniversary: A Celebration of Legacy, Evolution and Community

May 2025 marks a monumental milestone in software development: Java turns 30. The impact of this language on the […]