Updating Applications on Application Servers
When running or debugging a Java EE or Web application, you can modify the source code and, almost immediately, see the result of your changes.
- Updating an application: Process overview
- Specifying application update options
- Updating an application
- Application update options
Updating an application: Process overview
- Specify the necessary application update options in your server run/debug configuration, see Specifying application update options.
- Start the run/debug configuration.
- After making changes to the source code, update your application, see Updating an application.
Specifying application update options
In server run/debug configurations, the following settings on the Server tab have to do with updating an application:
On 'Update' action.
The Update action refers to clicking
in the Run or the Debug tool window
(alternatively, Ctrl+F10 or
Use the list to select the default update option. See Application update options.
Show dialog. If this check box is not selected, the default update option is used. Otherwise, a dialog is shown that displays all the available update options, and you'll be able to select the necessary option prior to actually updating your application.
- On frame deactivation. Frame deactivation means switching from IntelliJ IDEA to a different application (e.g. a Web browser). Use the list to specify what IntelliJ IDEA should do in such cases.
Updating an application
When the Run or the Debug tool window is active, do one of the following:
- Click on the toolbar of the tool window.
- Press Ctrl+F10.
- Select .
If the necessary update option is associated with frame deactivation, your application is updated automatically when you switch from IntelliJ IDEA to a different application (e.g. a Web browser).
Note that you can turn the Update Resources on Frame Deactivation option on and off right in the Run or the Debug tool window. To do that, click .
You can also update your application in the Application Servers Tool Window by redeploying your application artifact ().
Application update options
The update options are different depending on:
- the artifact format, i.e. on whether the application artifact is exploded (unpacked) or packed (e.g. WAR, EAR)
- the run/debug configuration type, i.e. on whether the run/debug configuration is local or remote (see Local and remote run configurations)
|Update classes and resources||Changed resources are updated; changed Java classes (EJBs, servlets, etc.) are recompiled.
In the debug mode, the updated classes are hot-swapped. In the run mode, IntelliJ IDEA just updates the changed classes in the output folder. Whether such classes are actually reloaded in the running application, depends on the capabilities of the runtime being used.
|Exploded artifacts in local configurations|
|Hot swap classes||Changed classes are recompiled and reloaded at runtime. This option works only in the debug mode.||Packed artifacts in local configurations; exploded and packed artifacts in remote configurations|
|Redeploy||The application artifact is rebuilt and redeployed. The operation may be time-consuming.||Exploded and packed artifacts in local and remote configurations|
|Restart server||The server is restarted. The application artifact is rebuilt and redeployed. The operation may be very time-consuming.||Exploded and packed artifacts in local configurations|