Payara for Beginners - Adding Payara Server to Eclipse IDE
Originally published on 04 Apr 2017
Last updated on 05 Mar 2020
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!
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.
Related Posts
Jakarta EE 9.1 Launches!
Published on 25 May 2021
by Priya Khaira-Hanks
0 Comments
Payara Services are celebrating the release of Jakarta EE 9.1 Platform and Web Profile specifications and related TCKs.
With Jakarta EE 9.1, global source community Eclipse Foundation brings to Java developers the first incremental Jakarta EE ...
Payara Services Joins MicroProfile Working Group
Published on 20 Jan 2021
by Priya Khaira-Hanks
0 Comments
Payara is pleased to announce that we have joined the MicroProfile Working Group. This builds on our commitment to shaping and improving Enterprise Java for both microservices and monolithic architectures.
The MicroProfile project was born as ...