---
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"
canonical: "https://elide-dev.github.io/doclet/link-previews/example/runtime/BuildPlan.html"
---

# ▤ BuildPlan

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

Record in [`example.runtime`](index.md). Since 1.0. Reference types generally default to non-null in this null-marked scope.

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

Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html) > [`Record`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Record.html) > `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`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html) (non-null, implied by @NullMarked on package example.runtime): the fully qualified entry point
- `arguments` [`List`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/List.html)`<`[`String`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html)`>` (non-null, implied by @NullMarked on package example.runtime): compiler arguments in invocation order

**See also**

- Write a preparation step
- Feature tour
- Prepare your first build

## Constructors

### BuildPlan(String, List)
<a id="&lt;init&gt;(java.lang.String,java.util.List)"></a>`public BuildPlan(String mainClass, List<String> arguments)`. Creates a plan with a stable copy of the arguments. Cite: `example/runtime/BuildPlan.html#<init>(java.lang.String,java.util.List)`
Parameters: `mainClass` `String` (non-null, implied by @NullMarked on package example.runtime): the fully qualified entry point.
`arguments` `List<String>` (non-null, implied by @NullMarked on package example.runtime): compiler arguments in invocation order.

## Methods

### defaults(String)
<a id="defaults(java.lang.String)"></a>`public static BuildPlan defaults(String mainClass)`. Returns a plan for the entry point using default compiler settings. Cite: `example/runtime/BuildPlan.html#defaults(java.lang.String)`
Parameters: `mainClass` `String` (non-null, implied by @NullMarked on package example.runtime): the fully qualified entry point.
Returns `BuildPlan` (non-null, implied by @NullMarked on package example.runtime): a plan with an empty argument list.

### toString()
<a id="toString()"></a>`public final String toString()`. Returns a string containing the record class name and its component names and values. Cite: `example/runtime/BuildPlan.html#toString()`
Returns `String` (non-null, implied by @NullMarked on package example.runtime): Returns a string containing the record class name and its component names and values.
Overrides `toString()`.

### hashCode()
<a id="hashCode()"></a>`public final int hashCode()`. Returns a hash code computed from the record components. Cite: `example/runtime/BuildPlan.html#hashCode()`
Returns `int`: Returns a hash code computed from the record components.
Overrides `hashCode()`.

### equals(Object)
<a id="equals(java.lang.Object)"></a>`public final boolean equals(Object o)`. Returns whether the other object is a record of the same class with equal components. Cite: `example/runtime/BuildPlan.html#equals(java.lang.Object)`
Parameters: `o` `Object` (nullable, implied by JSpecify’s rule for record equals(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()
<a id="mainClass()"></a>`public String mainClass()`. the fully qualified entry point. Cite: `example/runtime/BuildPlan.html#mainClass()`
Returns `String` (non-null, implied by @NullMarked on package example.runtime): the fully qualified entry point.

### arguments()
<a id="arguments()"></a>`public List<String> arguments()`. compiler arguments in invocation order. Cite: `example/runtime/BuildPlan.html#arguments()`
Returns `List<String>` (non-null, implied by @NullMarked on package example.runtime): compiler arguments in invocation order.

## Inherited members

- From class [`Object`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html): [`getClass`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`notify`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`wait`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait%28long,int%29)
