JetBrains Fleet 1.42 Help

Run Java code

You can run your Java code right from JetBrains Fleet provided that you have configured a JDK, or if a build tool does that for you.

Quick way

If you are not going to pass any parameters to your program, and your program does not require any specific actions to be performed before start, you can run it right from the editor.

  1. Click the run icon in the gutter near the class or main method declaration and select Run.

    A menu appears on clicking run icons in the gutter
  2. Alternatively, place the caret at the class or main method that you want to run, and press ⌘ ⇧ R

Customizable way

If you are going to pass parameters to your program or otherwise customize the startup of your program, use a run/debug configuration.

A run configuration specifies the parameters for running your application. It includes commands, executable paths, environment variables, virtual machine options, arguments, and other necessary context.

Creating run configurations

  1. Click the Run icon (⌘ R) and select Create Run Configurations in run.json.

  2. In the run.json file that opens, define running or debugging parameters. If the file is empty, press ⌥ ⏎ or click the file template link.

    Alternatively, paste and edit the following code:

    { "configurations": [ { "name": "run sh", "type": "command", "program": "/bin/sh" }, { "name": "gradle run", "type": "gradle", "tasks": [ "run" ] } ] }

    Modify the configuration properties according to your environment.

    For more information about Java run configurations in JetBrains Fleet, refer to Java run configurations.

  3. Press ⌘ R or select Run | Run & Debug from the main menu. Select the configuration that you are going to run or debug.

The Run and Debug popup showing available run configurations

Manage running applications and tasks

Stop a task

  • Click the Stop button in the tab of the running task.

    The Stop icon in the top-right corner of a tab
  • Alternatively, close the tab, and select Terminate.

    A confirmation dialog shows asking if you really want to terminate the process

View running tasks

  • Press ⌘ R. Run & Debug popup opens and lists the tasks. The tasks that are currently running are indicated with a green circle.

    Running tasks displayed in the Run and Debug popup
Last modified: 11 February 2024