# How to run your program in IntelliJ

Running your program inside of IntelliJ is a fairly trivial process. We can do so via the run configuration system. First step is to actually create a configuration, which can be done by clicking the `ADD CONFIGURATION` button in the top right corner of your IDE.

![](/files/-MY0FH_fChgSnYAIviyd)

Upon clicking this, a modal will open where you can create a new configuration from a template. Specifically, we want to create a "JAR Application" configuration, so that's the template we'll use. Click the + in the top left of the modal, then scroll down to JAR Application and click it.

![](/files/-MY0FeMmjUnwtk-6zli1)

Call it whatever you want, for the purpose of this tutorial, I'll simply be naming mine "run". Set the path to jar to where ever your jar is. I personally run the jar inside it's build folder, and for gradle, that's build/libs. So for this project, I'd be setting the path to jar to `/media/piggy/HDD/Documents/Github/hotswapdemo/build/libs/hotswapdemo-1.0.0-all.jar`.

You'll usually want the working directory to be the same as the directory the jar is in, however this isn't a strict requirement. Things can just get a bit funky if you don't do this.

Finally, you'll want to fill out any other options required for your application (such as vm options & program arguments), and then set the JRE. Hit apply & ok in the bottom right when you're finished.

You can run the program via shift + f10, or by clicking the play button in the top right.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.helpch.at/piggys-barn/java/how-to-run-your-program-in-intellij.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
