Watch Aspire live streamsDocsTry Aspire
Watch Aspire live streamsDocsTry

withMainClass

Method
📦 Aspire.Hosting.Java v13.6.0-preview.1.26478.8
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
mainClassstring
JavaAppResource

Applies to

This method applies to the following types: