Watch Aspire live streamsDocsTry Aspire

JavaAppResource.withMainClass

Method
📦 Aspire.Hosting.Java v13.6.5-preview.1.26559.7
interface JavaAppResource {
// ... omitted for brevity
withMainClass(mainClass: string): JavaAppResource;
}

Signature

methodwithMainClassbuilder
Sets the main class an IDE launches when running or debugging this application. Has no effect on how Aspire starts the process, which is decided by the JAR path, Maven goal, or Gradle task.
withMainClass(mainClass: string): JavaAppResource
mainClassstringThe fully qualified name of the class declaring `main`, for example `com.example.Application`.
JavaAppResource

Defined on

This method is defined on the following type: