---
title: "BuildPlan"
description: "Describes how to build a Java application as a native executable."
kind: "record"
id: "example.runtime.BuildPlan"
module: "runtime-kit"
version: "1.0"
---

# BuildPlan

## API at a glance

- mainClass: the fully qualified entry point
- arguments: compiler arguments in invocation order
- BuildPlan(String, List): Creates a plan with a stable copy of the arguments.
- defaults(String): Returns a plan for the entry point using default compiler settings. Returns a plan with an empty argument list
- toString(): Returns a string containing the record class name and its component names and values.
- hashCode(): Returns a hash code computed from the record components.
- equals(Object): Returns whether the other object is a record of the same class with equal components.
- mainClass(): the fully qualified entry point

[runtime-kit](../../index.md) › [example.runtime](index.md) · Every page: [llms.txt](../../llms.txt)

Record in [`example.runtime`](index.md). Since 1.0.

```java
public record BuildPlan(String mainClass, List<String> arguments)
```

Inheritance: `Object` > `Record` > `BuildPlan`

Describes how to build a Java application as a native executable.

Pass this plan to a [`Planner.Local`](Planner.Local.md) for validation against a [`Target`](Target.md). For example:

```java
var plan = new BuildPlan("example.Main", List.of("-O2"));
```

**Record components**

- `mainClass` `String`: the fully qualified entry point
- `arguments` `List<String>`: compiler arguments in invocation order

**See also**

- [Write a preparation step](../../guides/custom-step.md)
- [Prepare your first build](../../guides/prepare-a-build.md)

## Constructors

### BuildPlan(String, List)

```java
public BuildPlan(String mainClass, List<String> arguments)
```

Creates a plan with a stable copy of the arguments.

**Parameters**

- `mainClass` `String`: the fully qualified entry point
- `arguments` `List<String>`: compiler arguments in invocation order

## Methods

### defaults(String)

```java
public static BuildPlan defaults(String mainClass)
```

Returns a plan for the entry point using default compiler settings.

**Parameters**

- `mainClass` `String`: the fully qualified entry point

**Returns** [`BuildPlan`](BuildPlan.md): a plan with an empty argument list

### toString()

```java
public final String toString()
```

Returns a string containing the record class name and its component names and values.

**Returns** `String`: Returns a string containing the record class name and its component names and values.

Overrides `toString()`.

### hashCode()

```java
public final int hashCode()
```

Returns a hash code computed from the record components.

**Returns** `int`: Returns a hash code computed from the record components.

Overrides `hashCode()`.

### equals(Object)

```java
public final boolean equals(Object o)
```

Returns whether the other object is a record of the same class with equal components.

**Parameters**

- `o` `Object`: The object to compare with this record.

**Returns** `boolean`: Returns whether the other object is a record of the same class with equal components.

Overrides `equals(java.lang.Object)`.

### mainClass()

```java
public String mainClass()
```

the fully qualified entry point

**Returns** `String`: the fully qualified entry point

### arguments()

```java
public List<String> arguments()
```

compiler arguments in invocation order

**Returns** `List<String>`: compiler arguments in invocation order

## Inherited members

- From class `Object`: `getClass`, `notify`, `notifyAll`, `wait`, `wait`, `wait`
