GlassFish 7 in Netbeans IDE
The Netbeans IDE distribution for Java EE / Jakarta EE supports GlassFish Server out of the box. Here we describe how use GlassFish Server in Netbeans and how to run your applications with it.
Workaround for GlassFish 7.1 and newer
The latest version of Netbeans doesn’t natively support GlassFish 7.1. The OmniFish team has prepared a workaround until a new version of Netbeans supports it.
To fix issues with starting GlassFish 7.1 from Netbeans 28 or older, just download the following plugin created by OmniFish (an NPM file) and install it into Netbeans:
To install it to Netbeans:
- Click on the Tools menu item in Netbeans
- Select Plugins
- Go to the Downloaded tab
- Click Add Plugins… and select the downloaded NPM file
- Check the Install checkbox
- Click Install button at the bottom
- Follow the instructions to install the plugin
After you install the plugin, Netbeans will start GlassFish as usual. No need to restart Netbeans.
There are still some known minor issues but the main functionality works as expected. All the rest will be fixed in a new Netbeans version.
How to add GlassFish server
To run applications on GlassFish from within Netbeans, you must register your GlassFish Server installation as a NetBeans server instance. Follow these instructions to register the GlassFish Server in NetBeans IDE.
- From the Tools menu, select Servers.
- In the Servers dialog, click Add Server.
- Under Choose Server, select GlassFish Server and click Next.
- Under Server Location, browse to or enter the location of your GlassFish Server installation.
- Click Next.
- Under Domain Location, select the default domain,
domain1. - Click Finish.
Then you can just run your application and select GlassFish as the server to run it – Right-click on your project in the Project or Package explorer, select Run, and then select the GlassFish server you added with the above steps. After your application is started successfully, Netbeans should open a web browser with the URL that should point to your application.
Here are similar instructions with pictures: https://stackoverflow.com/a/58083919/784594
Create and run an application
To create a web application in Netbeans and run it on GlassFish, you can follow this Netbeans tutorial: Getting Started with Java EE Applications