Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
div
classnavigation
HTML Table
width100%
Table Row (tr)
Table Cell (td)
width50%
Align
alignleft
Previous
span
classsep
|
span
classtext
Keymap
Table Cell (td)
width50%
Align
alignright
Top
span
classsep
|
span
classtext
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}

Wiki Markup
{redirect:https://www.jetbrains.com/idea/help/application-servers.html

...

|delay

...

=0}

Info
iconfalse

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
classshortcut
Settings
Application Servers
span
classshortcut
Wiki Markup
{span:class=shortcut}Settings{span}
Wiki Markup
{span:class=shortcut}Application Servers{span}
and click the Add application server
span
classshortcut
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

Web facet
span
classshortcut
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
span
classshortcut
Project Structure
span
classshortcut
Modules
and
span
classshortcut
Project Structure
Facets
span
classshortcut
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

Web facet
span
classshortcut
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

Run configurations
span
classshortcut
Wiki Markup
{span:class=shortcut}Run configurations{span}
. Each artifact has its name, type, output directory, layout and type (
span
classshortcut
Web Application: Archive
,
span
classshortcut
Web Application: Exploded
,
span
classshortcut
EJB Application: Archive
, EJB Application: Exploded
span
classshortcut
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
classshortcut
Project Structure
Artifacts
span
classshortcut
Wiki Markup
{span:class=shortcut}Project Structure{span}
Wiki Markup
{span:class=shortcut}Artifacts{span}
.

If you use

span
classshortcut
Maven
or Gradle
span
classshortcut
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

Run configuration
span
classshortcut
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:
span
classshortcut
Local
and
span
classshortcut
Remote
. The Local
span
classshortcut
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 Remote
span
classshortcut
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

Run configuration
span
classshortcut
Wiki Markup
{span:class=shortcut}Run configuration{span}
.

One important parameter here is

On ‘update’ action
span
classshortcut
Wiki Markup
{span:class=shortcut}On ‘update’ action{span}
, which defines how to update the application when you use the Update
span
classshortcut
Wiki Markup
{span:class=shortcut}Update{span}
action via
span
classshortcut
Ctrl
+
span
classshortcut
F10
(
span
classshortcut
Cmd
+ F10
span
classshortcut
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
classshortcut
update resources
,
span
classshortcut
update classes and resources
, or
span
classshortcut
redeploy
or restart the server
span
classshortcut
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 Show dialog
span
classshortcut
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

On frame deactivation
span
classshortcut
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
classshortcut
update resources
,
span
classshortcut
update classes and resources
, or do nothing
span
classshortcut
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

Exploded
span
classshortcut
Wiki Markup
{span:class=shortcut}Exploded{span}
artifact type. For the Archive
span
classshortcut
Wiki Markup
{span:class=shortcut}Archive{span}
artifact type use the common HotSwap
span
classshortcut
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

Before launch
span
classshortcut
Wiki Markup
{span:class=shortcut}Before launch{span}
group in the Run configuration
span
classshortcut
Wiki Markup
{span:class=shortcut}Run configuration{span}
dialog.

A

Remote
span
classshortcut
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

Run configuration
span
classshortcut
Wiki Markup
{span:class=shortcut}Run configuration{span}
is created, you can run or debug your application via the
span
classshortcut
Toolbar
, Run
span
classshortcut
Wiki Markup
{span:class=shortcut}Toolbar{span}
,
Wiki Markup
{span:class=shortcut}Run{span}
menu, or the shortcuts:
span
classshortcut
Run
via
span
classshortcut
Shift
+
span
classshortcut
F10
,
span
classshortcut
Debug
via
span
classshortcut
Shift
+ F9
span
classshortcut
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

Update
span
classshortcut
Wiki Markup
{span:class=shortcut}Update{span}
action via
span
classshortcut
Ctrl
+
span
classshortcut
F10
(
span
classshortcut
Cmd
+ F10
span
classshortcut
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 Update
span
classshortcut
Wiki Markup
{span:class=shortcut}Update{span}
action is only available for the Exploded
span
classshortcut
Wiki Markup
{span:class=shortcut}Exploded{span}
artifact type. Based on your choice, it can
span
classshortcut
update resources
or update classes and resources
span
classshortcut
Wiki Markup
{span:class=shortcut}update resources{span}
or
Wiki Markup
{span:class=shortcut}update classes and resources{span}
. When the Update
span
classshortcut
Wiki Markup
{span:class=shortcut}Update{span}
action is applied in the Debug
span
classshortcut
Wiki Markup
{span:class=shortcut}Debug{span}
mode, it uses the HotSwap
span
classshortcut
Wiki Markup
{span:class=shortcut}HotSwap{span}
; otherwise, it uses the Hot redeployment
span
classshortcut
Wiki Markup
{span:class=shortcut}Hot redeployment{span}
.

If you use the

Archive
span
classshortcut
Wiki Markup
{span:class=shortcut}Archive{span}
artifact type you can only rely on the HotSwap
span
classshortcut
Wiki Markup
{span:class=shortcut}HotSwap{span}
, which is done automatically when you are in the Debug
span
classshortcut
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
classshortcut
Build
Build artifacts
span
classshortcut
Wiki Markup
{span:class=shortcut}Build{span}
Wiki Markup
{span:class=shortcut}Build artifacts{span}
action.

8. Application servers tool window

Each

Run configuration
span
classshortcut
Wiki Markup
{span:class=shortcut}Run configuration{span}
is shown in the Application servers
span
classshortcut
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
classshortcut
Run
/Stop
span
classshortcut
Wiki Markup
{span:class=shortcut}Run{span}
/
Wiki Markup
{span:class=shortcut}Stop{span}
the server and
span
classshortcut
Deploy
/
span
classshortcut
Undeploy
/Configure
span
classshortcut
Wiki Markup
{span:class=shortcut}Deploy{span}
/
Wiki Markup
{span:class=shortcut}Undeploy{span}
/
Wiki Markup
{span:class=shortcut}Configure{span}
artifacts.

Info
iconfalse

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
classnavigation
HTML Table
width100%
Table Row (tr)
Table Cell (td)
width50%
Align
alignleft
Previous
span
classsep
|
span
classtext
Keymap
Table Cell (td)
width50%
Align
alignright
Top
span
classsep
|
span
classtext
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}