NetBeans

Installation

The current version of the plugin is compatible with NetBeans IDE 8.2 or newer. The installation may vary depending on NetBeans IDE version and operating system.

JRebel for NetBeans contains the JRebel Agent and it allows you to automatically generate JRebel configuration for projects. It also enables JRebel for applications and servers with a single click, and improves the debugging support in the IDE.


Install from NetBeans plugins

To install the JRebel Plugin for NetBeans via available plugins, follow these steps:

  1. Open Tools > Plugins. Select the Available Plugins tab.

  2. Locate the JRebel plugin from the list. Mark this plugin for installation by selecting the checkbox next to it. Press Install to continue.

../_images/netbeans-plugin-installation.png
  1. Continue through the installation wizard. You will need to agree to the license agreement. Once complete, your IDE requests a restart. Make it so.

../_images/netbeans-restart.png

Note

For NetBeans 9 and 10 Update Centers must be configured to include the NetBeans 8.2 repository that contains required JavaEE modules.

To do this in NetBeans 9, go to Tools > Plugins, open the Settings tab and add the following URL: http://updates.netbeans.org/netbeans/updates/8.2/uc/final/distribution/catalog.xml.gz

In NetBeans 10 Netbeans 8.2 Plugin Portal is already listed but deactivated. Activate it before installing JRebel for Netbeans.


Install from NBM archive

You can also get the JRebel plugin as an NBM archive. All released versions of the plugin are hosted at http://plugins.netbeans.org/plugin/22254/. Download this NBM archive to a location of your choice. To continue with the installation, follow these steps:

  1. Open Tools > Plugins. Select the Downloaded tab. Press Add Plugins… to continue.

../_images/netbeans-install-jrebel-nbm1.png
  1. Locate the downloaded NBM file, select it and press Open. Press Install to continue.

../_images/netbeans-install-jrebel-nbm2.png
  1. Continue through the installation wizard. You will need to agree to the license agreement. Once complete, your IDE requests a restart. Make it so.

../_images/netbeans-restart.png

Activation

Following the installation, you probably won’t have a license yet. Once your IDE restarts, the JRebel plugin will notify you about this. This happens via a popup notification:

../_images/intellij-license-popup.png

Click the link in this popup. The JRebel activation window will open. If you closed the popup, you can also open this window from Help > JRebel > Activation.

This window contains two tabs: Try JRebel for FREE and I already have a license.


Try JRebel for FREE

To start your 14-day free JRebel Trial, fill out this form, select I agree with the terms & conditions of the JRebel License Agreement and press Activate JRebel. It’s as easy as that!

../_images/intellij-activation-jrebel.png

I already have a license

Open this tab if you already have a JRebel license. You can select one of three activation options:

../_images/intellij-activation2-jrebel.png
  • Activation code – Select this and paste your trial activation code in the text field. Press Activate JRebel to activate using the activation code.

  • Choose license file from the hard drive (jrebel.lic) – Select this option if you bought a license. We will send you a jrebel.lic license file using email. Press Browse and locate your jrebel.lic license file on the hard drive. Next, press Activate JRebel to activate using the license file.

  • Connect to License Server – Select this option if your network administrator supplies you with a License Server Group URL. The Group URL is a unique URL, consisting of the License Server address and a unique key. Paste the Group URL into the first field and input your email address into the second. Press Activate JRebel when done to activate using the License Server. JRebel 6 requires License Server 3 or newer for activation.

If everything went according to plan, you should now have a fully functional JRebel installed!


Server configuration

JRebel is automatically enabled for all servers and standalone projects launched from NetBeans. To review these settings, open Help > JRebel > Configuration and select the Startup tab.

From here, you can review all servers configured for your NetBeans as well as any standalone applications in your workspace.

../_images/netbeans-enable-jrebel.png

When running your application servers externally (for example using a command line), select the Run locally from command line radio button in the Startup tab. Select your desired Java and application server type. Follow the instructions to generate a startup script or new configuration.

../_images/netbeans-startupcli-jrebel.png

When using remoting/cloud for JRebel, select the Run on a remote server radio button in the Startup tab. Select your desired Java, application server and operating system. Follow the instructions to download JRebel onto the remote server and generate the startup script.


Project configuration

JRebel requires just one configuration file to work its magic. This file is rebel.xml and it maps the running application to the workspace. This configuration file has to be present for projects executed on the local machine, with the application server being run from the IDE or from a command line. The JRebel IDE plugin can automate the configuration creation for you. The XML file is also automatically generated for your convenience.

Open the Window menu and select JRebel panel to display the dedicated JRebel tool panel in the workspace. You can also open this panel by right-clicking the JRebel file node in the project view and selecting Open JRebel panel.

../_images/netbeans-jrebel-toolwindow.png

This tool window lists all projects currently available in the workspace. Selecting the first checkbox next to a module name will automatically generate the rebel.xml configuration file. This file will be generated within the application’s source files. In case of Maven projects, this file will be placed into src/main/resources. This ensures that it will be picked up automatically during the build. The second checkbox should be selected only when using JRebel remote server support.

Note

Note that rebel.xml should be deployed with the application to the application container.

A dedicated configuration file should be generated for every module in the project. For more information please refer to the application configuration chapter.

Note

Once you have generated rebel.xml, you need to redeploy your application to the server for the configuration to take effect.

If you would like to make modifications to the configuration file, please see the full reference for rebel.xml file format.

Note that when using either Maven or Gradle for your project, you might consider using the respective plugin for generating rebel.xml (and not the IDE plugin). For more information, please refer to either Maven plugin or Gradle plugin.


Disable deployment on save

In order to prevent unintended redeploys, the Deploy on Save option for the project has to be disabled. To do this, right-click the project and select Properties. Select Run and deselect the Deploy on Save checkbox.

../_images/netbeans-disable-deploy-on-save.png

JRebel Support

You can quickly get in touch with JRebel Support using the embedded support dialog in Help > JRebel > Submit a Support Ticket.

From here, describe your issue and specify your email address for further contact. Enable trace level logging to give JRebel Support more information on what went wrong and choose to add the log files to the support ticket. Press Send when ready.

../_images/netbeans-support.png

Updating the NetBeans plugin

  1. Open Tools > Plugins.

  2. Find JRebel NetBeans IDE Plugin from the Updates list.

  3. Press Update to continue.

  4. Complete the installation.

  5. Restart NetBeans.

Note

To verify you current JRebel version, open Help > JRebel > Configuration and select the Advanced tab. When upgrading from very old plugin versions, a complete plugin uninstall and new version install is recommended instead.


Troubleshooting

It is possible to override the default NetBeans action associated with the IDE commands for Run and Debug (or execute custom actions directly). You can engage actions that will be executed in a separate JVM by Maven – to which NetBeans cannot directly pass JVM arguments (mvn jetty:run being one such example). In that case, the argument enabling JRebel would not get passed. Using the following option in Maven launch configuration might help you:

Env.MAVEN_OPTS="-agentpath:/path/to/your/jrebel"

If you do not wish to hard-code the path, you can use a JRebel NetBeans plugin metavariable that replaces the path:

Env.MAVEN_OPTS="-agentpath:${current.jrebel.agent.path}"

For more information, please refer to running server from command line.


IDE log level configuration

You can configure the JRebel IDE plugin log level using a command line parameter. You can add this parameter to your {user.home}/.jrebel/jrebel.properties file.

rebel.ide.log=[off|error|warn|info|debug|trace]

The default value for this property is info. The JRebel IDE plugin log file itself is stored in {user.home}/.jrebel/.