...
Wiki Markup |
---|
{div:class=navigation}
{table:width=100%}
{tr}
{td:width=50%}{align:left}[Previous|Keymap] {span:class=sep}\| {span}{span:class=text}Keymap{span}{align}{td}
{td:width=50%}{align:right}[Top|Quick Start] {span:class=sep}\| {span}{span:class=text}Quick Start{span}{align} {td}
{tr}
{table}
{div} |
Wiki Markup |
---|
{redirect:https://www.jetbrains.com/idea/help/application-servers.html |
...
...
Info |
---|
|
IntelliJ IDEA Ultimate comes with out-of-the-box support for the most popular enterprise and open-source application servers including GlassFish, WebLogic, JBoss EAP, Wildfly, WebSphere, Tomcat, TomEE, Jetty, Geronimo, Resin and Virgo. |
...
To configure a server in the IDE, go to
→ span |
---|
|
Application Servers Wiki Markup |
---|
{span:class=shortcut}Settings{span} |
→ Wiki Markup |
---|
{span:class=shortcut}Application Servers{span} |
and click the
span |
---|
|
Add application server Wiki Markup |
---|
{span:class=shortcut}Add application server{span} |
button. The IDE will automatically detect its version and ask you to select which libraries to add to the dependencies when the server is used in the project.
...
One important thing when working with an application server is the
span |
---|
|
Web facet Wiki Markup |
---|
{span:class=shortcut}Web facet{span} |
. This is where the IDE stores the web settings for each module of your project. These settings include the deployment descriptors and web resources roots, and are available in
→ and → span |
---|
|
Facets Wiki Markup |
---|
{span:class=shortcut}Project Structure{span} |
→ Wiki Markup |
---|
{span:class=shortcut}Modules{span} |
and Wiki Markup |
---|
{span:class=shortcut}Project Structure{span} |
→ Wiki Markup |
---|
{span:class=shortcut}Facets{span} |
.

Usually you don’t need to configure the
span |
---|
|
Web facet Wiki Markup |
---|
{span:class=shortcut}Web facet{span} |
manually. The IDE automatically detects the descriptors and web resource roots and offers to configure it.
...
An artifact is what the IDE deploys to a server when you run the application via
span |
---|
|
Run configurations Wiki Markup |
---|
{span:class=shortcut}Run configurations{span} |
. Each artifact has its name, type, output directory, layout and type (
span |
---|
|
Web Application: Archive |
, span |
---|
|
Web Application: Exploded |
, span |
---|
|
EJB Application: Archive |
, span |
---|
|
EJB Application: Exploded Wiki Markup |
---|
{span:class=shortcut}Web Application: Archive{span} |
, Wiki Markup |
---|
{span:class=shortcut}Web Application: Exploded{span} |
, Wiki Markup |
---|
{span:class=shortcut}EJB Application: Archive{span} |
, Wiki Markup |
---|
{span:class=shortcut}EJB Application: Exploded{span} |
, etc). To configure the artifacts, go to
→ span |
---|
|
Artifacts Wiki Markup |
---|
{span:class=shortcut}Project Structure{span} |
→ Wiki Markup |
---|
{span:class=shortcut}Artifacts{span} |
.

If you use
or span |
---|
|
Gradle Wiki Markup |
---|
{span:class=shortcut}Maven{span} |
or Wiki Markup |
---|
{span:class=shortcut}Gradle{span} |
, you don’t need to configure the artifacts manually. The IDE automatically synchronizes them with the artifacts defined in your build files.
4. Run configurations
A
span |
---|
|
Run configuration Wiki Markup |
---|
{span:class=shortcut}Run configuration{span} |
defines how the artifacts are deployed to the server. IntelliJ IDEA has two types of Run configurations:
and . The span |
---|
|
Local Wiki Markup |
---|
{span:class=shortcut}Local{span} |
and Wiki Markup |
---|
{span:class=shortcut}Remote{span} |
. The Wiki Markup |
---|
{span:class=shortcut}Local{span} |
run configuration starts a new instance of the server and deploys artifacts there. The
span |
---|
|
Remote Wiki Markup |
---|
{span:class=shortcut}Remote{span} |
run configuration deploys the artifacts to an already running standalone server.
...
Each application server may have a different set of parameters in a
span |
---|
|
Run configuration Wiki Markup |
---|
{span:class=shortcut}Run configuration{span} |
.

One important parameter here is
span |
---|
|
On ‘update’ action Wiki Markup |
---|
{span:class=shortcut}On ‘update’ action{span} |
, which defines how to update the application when you use the
span |
---|
|
Update Wiki Markup |
---|
{span:class=shortcut}Update{span} |
action via
+ (+ span |
---|
|
F10 Wiki Markup |
---|
{span:class=shortcut}Ctrl{span} |
+ Wiki Markup |
---|
{span:class=shortcut}F10{span} |
( Wiki Markup |
---|
{span:class=shortcut}Cmd{span} |
+ Wiki Markup |
---|
{span:class=shortcut}F10{span} |
for Mac). Based on your choice, the IDE can
, span |
---|
|
update classes and resources |
, or or span |
---|
|
restart the server Wiki Markup |
---|
{span:class=shortcut}update resources{span} |
, Wiki Markup |
---|
{span:class=shortcut}update classes and resources{span} |
, or Wiki Markup |
---|
{span:class=shortcut}redeploy{span} |
or Wiki Markup |
---|
{span:class=shortcut}restart the server{span} |
. Turn off the
span |
---|
|
Show dialog Wiki Markup |
---|
{span:class=shortcut}Show dialog{span} |
checkbox if you don’t like to see the dialog each time you update the application. This is a great time-saver when you update your application very frequently.
Another important parameter is the
span |
---|
|
On frame deactivation Wiki Markup |
---|
{span:class=shortcut}On frame deactivation{span} |
, which defines how to update the application when you switch from the IDE, say to a browser. Based on these settings, the IDE can
, span |
---|
|
update classes and resources |
, or span |
---|
|
do nothing Wiki Markup |
---|
{span:class=shortcut}update resources{span} |
, Wiki Markup |
---|
{span:class=shortcut}update classes and resources{span} |
, or Wiki Markup |
---|
{span:class=shortcut}do nothing{span} |
. This setting may be very useful when you’d like to have your application updated automatically each time when you switch to a browser.
Keep in mind that update resources and update classes and resources options are available only for the
span |
---|
|
Exploded Wiki Markup |
---|
{span:class=shortcut}Exploded{span} |
artifact type. For the
span |
---|
|
Archive Wiki Markup |
---|
{span:class=shortcut}Archive{span} |
artifact type use the common
span |
---|
|
HotSwap Wiki Markup |
---|
{span:class=shortcut}HotSwap{span} |
.
By default, the IDE runs the application server using the project JRE. However, you can always choose to use an alternative JRE.
...
By default, the IDE automatically builds the artifacts before deploying. However you can change it using the
span |
---|
|
Before launch Wiki Markup |
---|
{span:class=shortcut}Before launch{span} |
group in the
span |
---|
|
Run configuration Wiki Markup |
---|
{span:class=shortcut}Run configuration{span} |
dialog.
A
span |
---|
|
Remote Wiki Markup |
---|
{span:class=shortcut}Remote{span} |
run configuration has additional parameters such as the host/port of the server you’d like to deploy your artifacts to.
...
5. Run and debug application
Once a
span |
---|
|
Run configuration Wiki Markup |
---|
{span:class=shortcut}Run configuration{span} |
is created, you can run or debug your application via the
, span |
---|
|
Run Wiki Markup |
---|
{span:class=shortcut}Toolbar{span} |
, Wiki Markup |
---|
{span:class=shortcut}Run{span} |
menu, or the shortcuts:
via + , via + span |
---|
|
F9 Wiki Markup |
---|
{span:class=shortcut}Run{span} |
via Wiki Markup |
---|
{span:class=shortcut}Shift{span} |
+ Wiki Markup |
---|
{span:class=shortcut}F10{span} |
, Wiki Markup |
---|
{span:class=shortcut}Debug{span} |
via Wiki Markup |
---|
{span:class=shortcut}Shift{span} |
+ Wiki Markup |
---|
{span:class=shortcut}F9{span} |
.

6. Update and HotSwap
When you need to apply changes in the code to a running application, we recommend using the
span |
---|
|
Update Wiki Markup |
---|
{span:class=shortcut}Update{span} |
action via
+ ( + span |
---|
|
F10 Wiki Markup |
---|
{span:class=shortcut}Ctrl{span} |
+ Wiki Markup |
---|
{span:class=shortcut}F10{span} |
( Wiki Markup |
---|
{span:class=shortcut}Cmd{span} |
+ Wiki Markup |
---|
{span:class=shortcut}F10{span} |
for Mac). As mentioned above, the
span |
---|
|
Update Wiki Markup |
---|
{span:class=shortcut}Update{span} |
action is only available for the
span |
---|
|
Exploded Wiki Markup |
---|
{span:class=shortcut}Exploded{span} |
artifact type. Based on your choice, it can
or span |
---|
|
update classes and resources Wiki Markup |
---|
{span:class=shortcut}update resources{span} |
or Wiki Markup |
---|
{span:class=shortcut}update classes and resources{span} |
. When the
span |
---|
|
Update Wiki Markup |
---|
{span:class=shortcut}Update{span} |
action is applied in the
span |
---|
|
Debug Wiki Markup |
---|
{span:class=shortcut}Debug{span} |
mode, it uses the
span |
---|
|
HotSwap Wiki Markup |
---|
{span:class=shortcut}HotSwap{span} |
; otherwise, it uses the
span |
---|
|
Hot redeployment Wiki Markup |
---|
{span:class=shortcut}Hot redeployment{span} |
.

If you use the
span |
---|
|
Archive Wiki Markup |
---|
{span:class=shortcut}Archive{span} |
artifact type you can only rely on the
span |
---|
|
HotSwap Wiki Markup |
---|
{span:class=shortcut}HotSwap{span} |
, which is done automatically when you are in the
span |
---|
|
Debug Wiki Markup |
---|
{span:class=shortcut}Debug{span} |
mode.
7. Build artifacts
You can always ask the IDE to build your artifacts on via the
→ span |
---|
|
Build artifacts Wiki Markup |
---|
{span:class=shortcut}Build{span} |
→ Wiki Markup |
---|
{span:class=shortcut}Build artifacts{span} |
action.

8. Application servers tool window
Each
span |
---|
|
Run configuration Wiki Markup |
---|
{span:class=shortcut}Run configuration{span} |
is shown in the
span |
---|
|
Application servers Wiki Markup |
---|
{span:class=shortcut}Application servers{span} |
tool window, along with the server and artifacts state. This tool window also helps you easily
/ span |
---|
|
Stop Wiki Markup |
---|
{span:class=shortcut}Run{span} |
/ Wiki Markup |
---|
{span:class=shortcut}Stop{span} |
the server and
// span |
---|
|
Configure Wiki Markup |
---|
{span:class=shortcut}Deploy{span} |
/ Wiki Markup |
---|
{span:class=shortcut}Undeploy{span} |
/ Wiki Markup |
---|
{span:class=shortcut}Configure{span} |
artifacts.

Info |
---|
|
See also Getting Started with Java EE 7 and GlassFish 4.0 on how to create, configure, deploy and debug Java EE 7 application using GlassFish 4.0. |
div |
---|
|
HTML Table |
---|
|
Table Row (tr) |
---|
Table Cell (td) |
---|
|
Align |
---|
|
Top span |
---|
|
Quick Start Wiki Markup |
---|
{div:class=navigation}
{table:width=100%}
{tr}
{td:width=50%}{align:left}[Previous|Keymap] {span:class=sep}\| {span}{span:class=text}Keymap{span}{align}{td}
{td:width=50%}{align:right}[Top|Quick Start] {span:class=sep}\| {span}{span:class=text}Quick Start{span}{align} {td}
{tr}
{table}
{div} |