Run targetsUltimate
You can run your code in another environment such as cloud or a Docker container directly from IntelliJ IDEA.
This feature allows you to instantly test the changes against the real environment the app is intended for. This ensures that there will be no incompatibilities when moving to production, which is especially important when working on code that heavily depends on the environment.
Running the app directly in such environment also spares you the extra actions normally required to deploy and run the app every time something changes.
The environment that is used for running the app is referred to as target. For IntelliJ IDEA to run code on a target, the target has to define a language runtime, which represents something on the target that can be used by a run/debug configuration to run code. For example, the Application and Maven run/debug configurations would need a JDK and Maven respectively.
In order to run your code on a target, all you need is to define the target execution environment in the run/debug configuration that you would normally use for local run. After you have done that, launching the app on a target is no different than launching it locally.
Supported run/debug configuration types
The following run/debug configurations can run on a remote target:
Create a run/debug configuration
From the main menu, select Run | Edit Configurations. Alternatively, press Alt+Shift+F10, then 0.
In the Run/Debug Configuration dialog, click the Add button
on the toolbar or press Alt+Insert. The list shows the run/debug configuration templates.
Select one of the supported run/debug configuration types.
If you have already defined the target, select it from the Run on menu. Otherwise, click Manage targets to add a new target. For instructions on configuring a particular target type, refer to the following procedures:
Run
Procedure for running the app on a remote target is the same as for running it locally:
Select the run/debug configuration on the main toolbar.
Click
or press Shift+F10.
IntelliJ IDEA builds the artifacts and then copies them to the target. After that, it runs the app on the target using the specified runtime.
Debug, profile, and analyze coverage
You can debug, profile, and measure coverage for Java applications that run on a target in the exact same way as when they run locally.
note
When you use Async profiler, the settings on the Java Profiler page apply to the remote environment. If the target uses a different platform, the settings must be configured accordingly.
Target types
A target describes the configuration of the environment in which the application will run.
When you create a remote target, IntelliJ IDEA automatically detects the runtimes available in the remote environment. If required, you can manually configure additional runtimes.