# Running your code

> Run executes the file you have open, not a fixed entry point. Here is when that changes, and what the stored entry is still for.

Source: https://www.revquix.com/docs/projects/running-your-code
Last verified: 2026-09-03

---

Press **Run** and Revquix executes **the file you are looking at**. Not a fixed entry point chosen
when the project was created - whatever is open in the editor right now.

This surprises people who expect the usual behaviour, so it is worth saying plainly: if you open
`TwoSum.java` and hit Run, it runs `TwoSum.java`. Open `MergeSort.java`, hit Run, and it runs that.
You do not have to tell the project which file matters.

## Why it works this way

A project is usually a folder of independent programs - a set of DSA solutions, each with its own
`main`, each meant to be run on its own.

Pinning a single entry point would mean every one of those runs `Main.java`, and the only way to
run the file in front of you would be a trip to the file tree's context menu before every single
run. That is not a preference setting; it is the feature not working.

## When Run falls back to the stored entry

Every project keeps a stored **entry file**, marked in the file tree. Run uses it in two situations:

1. **Nothing is open.** Running from a project list row, where there is no editor and therefore no
   open file.

2. **The open file is not runnable.** A header, a `README`, a `.json` fixture, a stylesheet - Run
   falls back to the entry rather than refusing.

Both files stay visible: the stored entry is marked in the tree, so you can always see which file
Run would fall back to.

## What counts as "runnable"

**The extension, and only the extension.** The list of runnable extensions comes from the server
per project type, so it is one table rather than a rule duplicated in the editor.

> **Note** - A file with no main is still a valid target
>
> Run does **not** inspect your code to decide whether it looks like a program. A `.java` file with
> no `main` method is a legal thing to run - the JVM answers `Main method not found in class Helper`,
> which is accurate and actionable.
>
> Guessing, and quietly running something _else_ because this file "looks like a helper", is the
> behaviour this replaced. A tool that runs a different file than the one you asked for is worse than
> one that reports a clear error.

## Web projects are the exception

A Web project has no Run button at all - the preview pane renders it live, and the preview _is_ the
run. Following the open file there was a real bug rather than a feature, and [web projects and preview](https://www.revquix.com/docs/projects/web-projects-and-preview) covers
why.

## Changing the stored entry

Right-click any runnable file in the file tree and set it as the entry. It changes the fallback -
what runs when nothing relevant is open - and never overrides the file you currently have open.

## When a run is refused

A run can be rejected before it starts. The two you are most likely to meet:

- **A file is over the run ceiling.** A file can be stored at up to 100 KiB but only run at 64 KiB,
  and the message names the file. See [project limits](https://www.revquix.com/docs/projects/project-limits).
- **The runner is unavailable.** The sandbox is a separate service and can be down. Nothing is lost
  and your files are untouched.

[When something goes wrong](https://www.revquix.com/docs/projects/when-something-goes-wrong) lists
the rest.

- [Giving your program input](https://www.revquix.com/docs/projects/giving-your-program-input) - The Input tab, and why prompts do not wait.

- [Project limits](https://www.revquix.com/docs/projects/project-limits) - Every ceiling, including the two file sizes.
