# JavaAppExecutableResource

- Module: [CommunityToolkit.Aspire.Hosting.Java](/reference/api/typescript/communitytoolkit.aspire.hosting.java.md)
- Version: `13.4.0`
- Kind: `handle`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire)

A resource that represents a Java application.

## Definition

```typescript
interface JavaAppExecutableResource
  extends IComputeResource,
    IResource,
    IResourceWithArgs,
    IResourceWithEndpoints,
    IResourceWithEnvironment,
    IResourceWithProbes,
    IResourceWithWaitSupport,
    IResourceWithServiceDiscovery {
  jarPath: string;
  withGradleBuild(args: string[]): JavaAppExecutableResource;
  withGradleTask(
      task: string,
      args: string[]): JavaAppExecutableResource;
  withMavenBuild(args: string[]): JavaAppExecutableResource;
  withMavenGoal(
      goal: string,
      args: string[]): JavaAppExecutableResource;
  withWrapperPath(wrapperScript: string): JavaAppExecutableResource;
}
```

## Properties

- `jarPath`: `string` `get - set` -- Gets or sets the path to the JAR file to execute.

## Methods

- [withGradleBuild](/reference/api/typescript/communitytoolkit.aspire.hosting.java/javaappexecutableresource/withgradlebuild.md) -- `method` -- Adds a Gradle build step to the Java application
    ```typescript
  withGradleBuild(args: string[]): JavaAppExecutableResource
  ```
- [withGradleTask](/reference/api/typescript/communitytoolkit.aspire.hosting.java/javaappexecutableresource/withgradletask.md) -- `method` -- Configures the Java application to run using a Gradle task
    ```typescript
  withGradleTask(task: string, args: string[]): JavaAppExecutableResource
  ```
- [withMavenBuild](/reference/api/typescript/communitytoolkit.aspire.hosting.java/javaappexecutableresource/withmavenbuild.md) -- `method` -- Adds a Maven build step to the Java application
    ```typescript
  withMavenBuild(args: string[]): JavaAppExecutableResource
  ```
- [withMavenGoal](/reference/api/typescript/communitytoolkit.aspire.hosting.java/javaappexecutableresource/withmavengoal.md) -- `method` -- Configures the Java application to run using a Maven goal
    ```typescript
  withMavenGoal(goal: string, args: string[]): JavaAppExecutableResource
  ```
- [withWrapperPath](/reference/api/typescript/communitytoolkit.aspire.hosting.java/javaappexecutableresource/withwrapperpath.md) -- `method` -- Configures a custom build tool wrapper script path. This is useful when the wrapper script is not in the default location or has a non-standard name.
    ```typescript
  withWrapperPath(wrapperScript: string): JavaAppExecutableResource
  ```
